Skip to content

Commit

Permalink
Add construct:else (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom authored Nov 28, 2023
1 parent 497da1e commit a9ce7f8
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Exercism.Analyzers.CSharp/Analyzers/TagAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public override void VisitIfStatement(IfStatementSyntax node)
base.VisitIfStatement(node);
}

public override void VisitElseClause(ElseClauseSyntax node)
{
AddTags(Tags.ConstructElse);
base.VisitElseClause(node);
}

public override void VisitSwitchStatement(SwitchStatementSyntax node)
{
AddTags(Tags.ConstructSwitch);
Expand Down Expand Up @@ -1175,6 +1181,7 @@ private static class Tags
public const string ConstructDivide = "construct:divide";
public const string ConstructDivideAssignment = "construct:divide-assignment";
public const string ConstructDoLoop = "construct:do-loop";
public const string ConstructElse = "construct:else";
public const string ConstructEquality = "construct:equality";
public const string ConstructEvent = "construct:event";
public const string ConstructEventHandler = "construct:event-handler";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"construct:class",
"construct:constructor",
"construct:divide",
"construct:else",
"construct:equality",
"construct:if",
"construct:inequality",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"construct:class",
"construct:constructor",
"construct:divide",
"construct:else",
"construct:equality",
"construct:if",
"construct:inequality",
Expand Down
1 change: 1 addition & 0 deletions tests/isogram/approaches/bitfield/expected_tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"construct:bitwise-or-assignment",
"construct:boolean",
"construct:class",
"construct:else",
"construct:foreach",
"construct:if",
"construct:implicit-conversion",
Expand Down
1 change: 1 addition & 0 deletions tests/pangram/approaches/bitfield/expected_tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"construct:bitwise-or-assignment",
"construct:boolean",
"construct:class",
"construct:else",
"construct:equality",
"construct:foreach",
"construct:if",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"construct:class",
"construct:constructor",
"construct:dictionary",
"construct:else",
"construct:foreach",
"construct:if",
"construct:implicit-conversion",
Expand Down
1 change: 1 addition & 0 deletions tests/tags/constructs/flow-control/expected_tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"construct:conditional-access",
"construct:continue",
"construct:default",
"construct:else",
"construct:equality",
"construct:file-scoped-namespace",
"construct:for-loop",
Expand Down
1 change: 1 addition & 0 deletions tests/two-fer/if/expected_tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"tags": [
"construct:add",
"construct:class",
"construct:else",
"construct:equality",
"construct:if",
"construct:method",
Expand Down

0 comments on commit a9ce7f8

Please sign in to comment.