@@ -6,17 +6,18 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
66{
77 internal class Labeled : Statement < LabeledStatementSyntax >
88 {
9- private readonly Statement parent ;
9+ private readonly IStatementParentEntity parent ;
1010 private readonly int child ;
11+ private Statement labelledStmt ;
1112
12- private Labeled ( Context cx , LabeledStatementSyntax stmt , Statement parent , int child )
13+ private Labeled ( Context cx , LabeledStatementSyntax stmt , IStatementParentEntity parent , int child )
1314 : base ( cx , stmt , StmtKind . LABEL , parent , child )
1415 {
1516 this . parent = parent ;
1617 this . child = child ;
1718 }
1819
19- public static Labeled Create ( Context cx , LabeledStatementSyntax node , Statement parent , int child )
20+ public static Labeled Create ( Context cx , LabeledStatementSyntax node , IStatementParentEntity parent , int child )
2021 {
2122 var ret = new Labeled ( cx , node , parent , child ) ;
2223 ret . TryPopulate ( ) ;
@@ -27,13 +28,11 @@ protected override void PopulateStatement(TextWriter trapFile)
2728 {
2829 trapFile . exprorstmt_name ( this , Stmt . Identifier . ToString ( ) ) ;
2930
30- // For compatilibty with the Mono extractor, make insert the labelled statement into the same block
31+ // For compatibility with the Mono extractor, make insert the labelled statement into the same block
3132 // as this one. The parent MUST be a block statement.
3233 labelledStmt = Statement . Create ( cx , Stmt . Statement , parent , child + 1 ) ;
3334 }
3435
35- private Statement labelledStmt ;
36-
3736 public override int NumberOfStatements => 1 + labelledStmt . NumberOfStatements ;
3837 }
3938}
0 commit comments