@@ -6,17 +6,18 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
6
6
{
7
7
internal class Labeled : Statement < LabeledStatementSyntax >
8
8
{
9
- private readonly Statement parent ;
9
+ private readonly IStatementParentEntity parent ;
10
10
private readonly int child ;
11
+ private Statement labelledStmt ;
11
12
12
- private Labeled ( Context cx , LabeledStatementSyntax stmt , Statement parent , int child )
13
+ private Labeled ( Context cx , LabeledStatementSyntax stmt , IStatementParentEntity parent , int child )
13
14
: base ( cx , stmt , StmtKind . LABEL , parent , child )
14
15
{
15
16
this . parent = parent ;
16
17
this . child = child ;
17
18
}
18
19
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 )
20
21
{
21
22
var ret = new Labeled ( cx , node , parent , child ) ;
22
23
ret . TryPopulate ( ) ;
@@ -27,13 +28,11 @@ protected override void PopulateStatement(TextWriter trapFile)
27
28
{
28
29
trapFile . exprorstmt_name ( this , Stmt . Identifier . ToString ( ) ) ;
29
30
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
31
32
// as this one. The parent MUST be a block statement.
32
33
labelledStmt = Statement . Create ( cx , Stmt . Statement , parent , child + 1 ) ;
33
34
}
34
35
35
- private Statement labelledStmt ;
36
-
37
36
public override int NumberOfStatements => 1 + labelledStmt . NumberOfStatements ;
38
37
}
39
38
}
0 commit comments