From 4a716c6005cd60579a2eea80b6bf9020eeeb7e95 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 20 Dec 2024 15:00:30 +0100 Subject: [PATCH 1/3] C#: Add a test example in the statements test. --- .../library-tests/statements/statements.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/csharp/ql/test/library-tests/statements/statements.cs b/csharp/ql/test/library-tests/statements/statements.cs index 971631444dc3..e034404a00f6 100644 --- a/csharp/ql/test/library-tests/statements/statements.cs +++ b/csharp/ql/test/library-tests/statements/statements.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Collections.Generic; +using System.Threading; namespace Statements { @@ -9,7 +10,7 @@ class Class static void Main() { - block: + block: { { } @@ -166,8 +167,8 @@ static void MainGoto(string[] args) { int i = 0; goto check; - loop: Console.WriteLine(args[i++]); - check: if (i < args.Length) goto loop; + loop: Console.WriteLine(args[i++]); + check: if (i < args.Length) goto loop; } static int Add(int a, int b) @@ -272,9 +273,19 @@ static void MainUsing() static void MainLabeled() { goto Label; - Label: + Label: int x = 23; x = 9; } + + private readonly Lock lockObject = new Lock(); + + public void LockMethod() + { + lock (lockObject) + { + Console.WriteLine("Locked"); + } + } } } From 29a0db805317d32c357c7c34140d4ed86c45b955 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 20 Dec 2024 15:00:54 +0100 Subject: [PATCH 2/3] C#: Update test expected output. --- .../library-tests/statements/Block4.expected | 2 +- .../library-tests/statements/Break1.expected | 2 +- .../statements/Checked1.expected | 2 +- .../statements/CompilerGenerated.expected | 4 +- .../statements/Continue1.expected | 2 +- .../library-tests/statements/Do2.expected | 2 +- .../library-tests/statements/Expr1.expected | 2 +- .../library-tests/statements/For2.expected | 2 +- .../library-tests/statements/For3.expected | 2 +- .../library-tests/statements/For4.expected | 2 +- .../statements/Foreach2.expected | 2 +- .../statements/Foreach3.expected | 2 +- .../library-tests/statements/Goto1.expected | 2 +- .../library-tests/statements/Goto2.expected | 2 +- .../library-tests/statements/If2.expected | 2 +- .../statements/Labeled1.expected | 2 +- .../statements/LocalConstDecl1.expected | 2 +- .../statements/LocalConstDecl2.expected | 2 +- .../statements/LocalConstDecl3.expected | 2 +- .../statements/LocalVarDecl1.expected | 2 +- .../statements/LocalVarDecl2.expected | 2 +- .../statements/LocalVarDecl3.expected | 2 +- .../statements/LocalVarDecl4.expected | 2 +- .../statements/LocalVarDecl5.expected | 2 +- .../library-tests/statements/Lock2.expected | 2 +- .../statements/PrintAst.expected | 1243 +++++++++-------- .../library-tests/statements/Return1.expected | 2 +- .../library-tests/statements/Return2.expected | 2 +- .../statements/StripSingletonBlocks.expected | 48 +- .../library-tests/statements/Switch1.expected | 4 +- .../library-tests/statements/Switch2.expected | 22 +- .../library-tests/statements/Switch3.expected | 2 +- .../library-tests/statements/Switch4.expected | 3 +- .../library-tests/statements/Throw1.expected | 2 +- .../statements/TryCatch2.expected | 4 +- .../statements/TryCatch3.expected | 4 +- .../statements/TryCatch4.expected | 2 +- .../statements/TryCatch5.expected | 2 +- .../statements/TryCatch6.expected | 2 +- .../statements/TryCatch7.expected | 2 +- .../statements/TryCatch8.expected | 2 +- .../statements/TryFinally1.expected | 2 +- .../statements/Unchecked1.expected | 2 +- .../library-tests/statements/Using2.expected | 2 +- .../library-tests/statements/Using3.expected | 2 +- .../library-tests/statements/While2.expected | 2 +- 46 files changed, 713 insertions(+), 695 deletions(-) diff --git a/csharp/ql/test/library-tests/statements/Block4.expected b/csharp/ql/test/library-tests/statements/Block4.expected index 0487d389c4bd..900d7be7c35c 100644 --- a/csharp/ql/test/library-tests/statements/Block4.expected +++ b/csharp/ql/test/library-tests/statements/Block4.expected @@ -1 +1 @@ -| statements.cs:10:21:10:24 | Main | +| statements.cs:11:21:11:24 | Main | diff --git a/csharp/ql/test/library-tests/statements/Break1.expected b/csharp/ql/test/library-tests/statements/Break1.expected index ca2b3137ad86..fa78bfdbba7b 100644 --- a/csharp/ql/test/library-tests/statements/Break1.expected +++ b/csharp/ql/test/library-tests/statements/Break1.expected @@ -1 +1 @@ -| statements.cs:146:21:146:29 | MainBreak | statements.cs:151:32:151:37 | break; | +| statements.cs:147:21:147:29 | MainBreak | statements.cs:152:32:152:37 | break; | diff --git a/csharp/ql/test/library-tests/statements/Checked1.expected b/csharp/ql/test/library-tests/statements/Checked1.expected index b7180ba4ce22..2ddf5b6bcb7c 100644 --- a/csharp/ql/test/library-tests/statements/Checked1.expected +++ b/csharp/ql/test/library-tests/statements/Checked1.expected @@ -1 +1 @@ -| statements.cs:233:13:236:13 | checked {...} | statements.cs:234:13:236:13 | {...} | +| statements.cs:234:13:237:13 | checked {...} | statements.cs:235:13:237:13 | {...} | diff --git a/csharp/ql/test/library-tests/statements/CompilerGenerated.expected b/csharp/ql/test/library-tests/statements/CompilerGenerated.expected index 26ad2f9db100..2c6994de7125 100644 --- a/csharp/ql/test/library-tests/statements/CompilerGenerated.expected +++ b/csharp/ql/test/library-tests/statements/CompilerGenerated.expected @@ -1,3 +1,3 @@ | fixed.cs:3:7:3:11 | {...} | fixed.cs:3:7:3:11 | Fixed | -| statements.cs:7:11:7:15 | {...} | statements.cs:7:11:7:15 | Class | -| statements.cs:243:15:243:25 | {...} | statements.cs:243:15:243:25 | AccountLock | +| statements.cs:8:11:8:15 | {...} | statements.cs:8:11:8:15 | Class | +| statements.cs:244:15:244:25 | {...} | statements.cs:244:15:244:25 | AccountLock | diff --git a/csharp/ql/test/library-tests/statements/Continue1.expected b/csharp/ql/test/library-tests/statements/Continue1.expected index c9036b326730..bd02de4a9ff6 100644 --- a/csharp/ql/test/library-tests/statements/Continue1.expected +++ b/csharp/ql/test/library-tests/statements/Continue1.expected @@ -1 +1 @@ -| statements.cs:156:21:156:32 | MainContinue | statements.cs:160:46:160:54 | continue; | +| statements.cs:157:21:157:32 | MainContinue | statements.cs:161:46:161:54 | continue; | diff --git a/csharp/ql/test/library-tests/statements/Do2.expected b/csharp/ql/test/library-tests/statements/Do2.expected index 836ad9a79a1e..f598482d6c6e 100644 --- a/csharp/ql/test/library-tests/statements/Do2.expected +++ b/csharp/ql/test/library-tests/statements/Do2.expected @@ -1 +1 @@ -| statements.cs:120:21:120:26 | MainDo | statements.cs:123:13:127:32 | do ... while (...); | +| statements.cs:121:21:121:26 | MainDo | statements.cs:124:13:128:32 | do ... while (...); | diff --git a/csharp/ql/test/library-tests/statements/Expr1.expected b/csharp/ql/test/library-tests/statements/Expr1.expected index c77ae1c2cfa1..4b8617d5f87c 100644 --- a/csharp/ql/test/library-tests/statements/Expr1.expected +++ b/csharp/ql/test/library-tests/statements/Expr1.expected @@ -1 +1 @@ -| statements.cs:47:21:47:28 | MainExpr | +| statements.cs:48:21:48:28 | MainExpr | diff --git a/csharp/ql/test/library-tests/statements/For2.expected b/csharp/ql/test/library-tests/statements/For2.expected index fd34e277bc17..933ffe0a5053 100644 --- a/csharp/ql/test/library-tests/statements/For2.expected +++ b/csharp/ql/test/library-tests/statements/For2.expected @@ -1 +1 @@ -| statements.cs:132:13:135:13 | for (...;...;...) ... | statements.cs:132:29:132:43 | ... < ... | +| statements.cs:133:13:136:13 | for (...;...;...) ... | statements.cs:133:29:133:43 | ... < ... | diff --git a/csharp/ql/test/library-tests/statements/For3.expected b/csharp/ql/test/library-tests/statements/For3.expected index 7b7c071719a0..290547858d95 100644 --- a/csharp/ql/test/library-tests/statements/For3.expected +++ b/csharp/ql/test/library-tests/statements/For3.expected @@ -1 +1 @@ -| statements.cs:132:13:135:13 | for (...;...;...) ... | statements.cs:132:46:132:48 | ...++ | +| statements.cs:133:13:136:13 | for (...;...;...) ... | statements.cs:133:46:133:48 | ...++ | diff --git a/csharp/ql/test/library-tests/statements/For4.expected b/csharp/ql/test/library-tests/statements/For4.expected index 4cebbdbca896..57ae299c7b42 100644 --- a/csharp/ql/test/library-tests/statements/For4.expected +++ b/csharp/ql/test/library-tests/statements/For4.expected @@ -1 +1 @@ -| statements.cs:132:13:135:13 | for (...;...;...) ... | statements.cs:132:22:132:26 | Int32 i = ... | +| statements.cs:133:13:136:13 | for (...;...;...) ... | statements.cs:133:22:133:26 | Int32 i = ... | diff --git a/csharp/ql/test/library-tests/statements/Foreach2.expected b/csharp/ql/test/library-tests/statements/Foreach2.expected index a2ac278539de..5f413adc3c6f 100644 --- a/csharp/ql/test/library-tests/statements/Foreach2.expected +++ b/csharp/ql/test/library-tests/statements/Foreach2.expected @@ -1 +1 @@ -| statements.cs:138:21:138:31 | MainForeach | +| statements.cs:139:21:139:31 | MainForeach | diff --git a/csharp/ql/test/library-tests/statements/Foreach3.expected b/csharp/ql/test/library-tests/statements/Foreach3.expected index 13ee448940b4..d77c2e2d2859 100644 --- a/csharp/ql/test/library-tests/statements/Foreach3.expected +++ b/csharp/ql/test/library-tests/statements/Foreach3.expected @@ -1 +1 @@ -| statements.cs:140:13:143:13 | foreach (... ... in ...) ... | statements.cs:140:29:140:29 | s | +| statements.cs:141:13:144:13 | foreach (... ... in ...) ... | statements.cs:141:29:141:29 | s | diff --git a/csharp/ql/test/library-tests/statements/Goto1.expected b/csharp/ql/test/library-tests/statements/Goto1.expected index a8bd72217c3c..4d4b5ac9beb4 100644 --- a/csharp/ql/test/library-tests/statements/Goto1.expected +++ b/csharp/ql/test/library-tests/statements/Goto1.expected @@ -1 +1 @@ -| statements.cs:165:21:165:28 | MainGoto | statements.cs:168:13:168:23 | goto ...; | +| statements.cs:166:21:166:28 | MainGoto | statements.cs:169:13:169:23 | goto ...; | diff --git a/csharp/ql/test/library-tests/statements/Goto2.expected b/csharp/ql/test/library-tests/statements/Goto2.expected index ded5b59d8c27..c2162082a92b 100644 --- a/csharp/ql/test/library-tests/statements/Goto2.expected +++ b/csharp/ql/test/library-tests/statements/Goto2.expected @@ -1 +1 @@ -| statements.cs:165:21:165:28 | MainGoto | statements.cs:170:41:170:50 | goto ...; | +| statements.cs:166:21:166:28 | MainGoto | statements.cs:171:37:171:46 | goto ...; | diff --git a/csharp/ql/test/library-tests/statements/If2.expected b/csharp/ql/test/library-tests/statements/If2.expected index 0b67530e1d99..723db4f14048 100644 --- a/csharp/ql/test/library-tests/statements/If2.expected +++ b/csharp/ql/test/library-tests/statements/If2.expected @@ -1 +1 @@ -| statements.cs:58:13:65:13 | if (...) ... | statements.cs:63:13:65:13 | {...} | +| statements.cs:59:13:66:13 | if (...) ... | statements.cs:64:13:66:13 | {...} | diff --git a/csharp/ql/test/library-tests/statements/Labeled1.expected b/csharp/ql/test/library-tests/statements/Labeled1.expected index 4c99ed211f25..a340cabc99f8 100644 --- a/csharp/ql/test/library-tests/statements/Labeled1.expected +++ b/csharp/ql/test/library-tests/statements/Labeled1.expected @@ -1 +1 @@ -| statements.cs:272:21:272:31 | MainLabeled | statements.cs:275:13:275:17 | Label: | +| statements.cs:273:21:273:31 | MainLabeled | statements.cs:276:9:276:13 | Label: | diff --git a/csharp/ql/test/library-tests/statements/LocalConstDecl1.expected b/csharp/ql/test/library-tests/statements/LocalConstDecl1.expected index e5f4fd42b2cc..2fd2f003fe19 100644 --- a/csharp/ql/test/library-tests/statements/LocalConstDecl1.expected +++ b/csharp/ql/test/library-tests/statements/LocalConstDecl1.expected @@ -1 +1 @@ -| statements.cs:40:21:40:38 | MainLocalConstDecl | statements.cs:42:13:42:40 | const ... ...; | statements.cs:42:25:42:39 | Single pi = ... | 3.1415927 | +| statements.cs:41:21:41:38 | MainLocalConstDecl | statements.cs:43:13:43:40 | const ... ...; | statements.cs:43:25:43:39 | Single pi = ... | 3.1415927 | diff --git a/csharp/ql/test/library-tests/statements/LocalConstDecl2.expected b/csharp/ql/test/library-tests/statements/LocalConstDecl2.expected index 202b86b91544..759e5318e127 100644 --- a/csharp/ql/test/library-tests/statements/LocalConstDecl2.expected +++ b/csharp/ql/test/library-tests/statements/LocalConstDecl2.expected @@ -1 +1 @@ -| statements.cs:40:21:40:38 | MainLocalConstDecl | statements.cs:43:13:43:33 | const ... ...; | statements.cs:43:23:43:32 | Int32 r = ... | +| statements.cs:41:21:41:38 | MainLocalConstDecl | statements.cs:44:13:44:33 | const ... ...; | statements.cs:44:23:44:32 | Int32 r = ... | diff --git a/csharp/ql/test/library-tests/statements/LocalConstDecl3.expected b/csharp/ql/test/library-tests/statements/LocalConstDecl3.expected index 202b86b91544..759e5318e127 100644 --- a/csharp/ql/test/library-tests/statements/LocalConstDecl3.expected +++ b/csharp/ql/test/library-tests/statements/LocalConstDecl3.expected @@ -1 +1 @@ -| statements.cs:40:21:40:38 | MainLocalConstDecl | statements.cs:43:13:43:33 | const ... ...; | statements.cs:43:23:43:32 | Int32 r = ... | +| statements.cs:41:21:41:38 | MainLocalConstDecl | statements.cs:44:13:44:33 | const ... ...; | statements.cs:44:23:44:32 | Int32 r = ... | diff --git a/csharp/ql/test/library-tests/statements/LocalVarDecl1.expected b/csharp/ql/test/library-tests/statements/LocalVarDecl1.expected index 471389613b4a..9e3955ced7ba 100644 --- a/csharp/ql/test/library-tests/statements/LocalVarDecl1.expected +++ b/csharp/ql/test/library-tests/statements/LocalVarDecl1.expected @@ -1 +1 @@ -| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:32:13:32:18 | ... ...; | statements.cs:32:17:32:17 | Int32 a | +| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:33:13:33:18 | ... ...; | statements.cs:33:17:33:17 | Int32 a | diff --git a/csharp/ql/test/library-tests/statements/LocalVarDecl2.expected b/csharp/ql/test/library-tests/statements/LocalVarDecl2.expected index 4b21e5f85132..b321249f5c9d 100644 --- a/csharp/ql/test/library-tests/statements/LocalVarDecl2.expected +++ b/csharp/ql/test/library-tests/statements/LocalVarDecl2.expected @@ -1 +1 @@ -| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:33:13:33:29 | ... ...; | statements.cs:33:17:33:21 | Int32 b = ... | +| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:34:13:34:29 | ... ...; | statements.cs:34:17:34:21 | Int32 b = ... | diff --git a/csharp/ql/test/library-tests/statements/LocalVarDecl3.expected b/csharp/ql/test/library-tests/statements/LocalVarDecl3.expected index 3c9a256236bb..dc0590ee5141 100644 --- a/csharp/ql/test/library-tests/statements/LocalVarDecl3.expected +++ b/csharp/ql/test/library-tests/statements/LocalVarDecl3.expected @@ -1 +1 @@ -| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:33:13:33:29 | ... ...; | statements.cs:33:17:33:21 | Int32 b = ... | statements.cs:33:24:33:28 | Int32 c = ... | +| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:34:13:34:29 | ... ...; | statements.cs:34:17:34:21 | Int32 b = ... | statements.cs:34:24:34:28 | Int32 c = ... | diff --git a/csharp/ql/test/library-tests/statements/LocalVarDecl4.expected b/csharp/ql/test/library-tests/statements/LocalVarDecl4.expected index 471389613b4a..9e3955ced7ba 100644 --- a/csharp/ql/test/library-tests/statements/LocalVarDecl4.expected +++ b/csharp/ql/test/library-tests/statements/LocalVarDecl4.expected @@ -1 +1 @@ -| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:32:13:32:18 | ... ...; | statements.cs:32:17:32:17 | Int32 a | +| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:33:13:33:18 | ... ...; | statements.cs:33:17:33:17 | Int32 a | diff --git a/csharp/ql/test/library-tests/statements/LocalVarDecl5.expected b/csharp/ql/test/library-tests/statements/LocalVarDecl5.expected index 87734ccea6a9..33d0f527b94a 100644 --- a/csharp/ql/test/library-tests/statements/LocalVarDecl5.expected +++ b/csharp/ql/test/library-tests/statements/LocalVarDecl5.expected @@ -1 +1 @@ -| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:37:13:37:27 | ... ...; | statements.cs:37:17:37:26 | String y = ... | +| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:38:13:38:27 | ... ...; | statements.cs:38:17:38:26 | String y = ... | diff --git a/csharp/ql/test/library-tests/statements/Lock2.expected b/csharp/ql/test/library-tests/statements/Lock2.expected index 359e45785b57..aa76edc6a713 100644 --- a/csharp/ql/test/library-tests/statements/Lock2.expected +++ b/csharp/ql/test/library-tests/statements/Lock2.expected @@ -1 +1 @@ -| statements.cs:248:17:255:17 | lock (...) {...} | statements.cs:248:23:248:26 | this access | statements.cs:249:17:255:17 | {...} | +| statements.cs:249:17:256:17 | lock (...) {...} | statements.cs:249:23:249:26 | this access | statements.cs:250:17:256:17 | {...} | diff --git a/csharp/ql/test/library-tests/statements/PrintAst.expected b/csharp/ql/test/library-tests/statements/PrintAst.expected index e082f1c502f8..6aea0fa286e4 100644 --- a/csharp/ql/test/library-tests/statements/PrintAst.expected +++ b/csharp/ql/test/library-tests/statements/PrintAst.expected @@ -50,653 +50,668 @@ fixed.cs: # 19| 0: [IntLiteral] 0 # 19| 0: [EmptyStmt] ; statements.cs: -# 5| [NamespaceDeclaration] namespace ... { ... } -# 7| 1: [Class] Class -# 10| 5: [Method] Main -# 10| -1: [TypeMention] Void -# 11| 4: [BlockStmt] {...} -# 12| 0: [LabelStmt] block: -# 13| 1: [BlockStmt] {...} -# 14| 0: [BlockStmt] {...} -# 16| 1: [BlockStmt] {...} -# 17| 0: [BlockStmt] {...} -# 23| 6: [Method] MainEmpty -# 23| -1: [TypeMention] Void -# 24| 4: [BlockStmt] {...} -# 25| 0: [LocalVariableDeclStmt] ... ...; -# 25| 0: [LocalVariableDeclAndInitExpr] Class c = ... -# 25| -1: [TypeMention] Class -# 25| 0: [LocalVariableAccess] access to local variable c -# 25| 1: [ObjectCreation] object creation of type Class -# 25| 0: [TypeMention] Class -# 26| 1: [EmptyStmt] ; -# 26| 2: [EmptyStmt] ; -# 26| 3: [EmptyStmt] ; -# 27| 4: [IfStmt] if (...) ... -# 27| 0: [BoolLiteral] true -# 27| 1: [EmptyStmt] ; -# 30| 7: [Method] MainLocalVarDecl -# 30| -1: [TypeMention] Void -# 31| 4: [BlockStmt] {...} -# 32| 0: [LocalVariableDeclStmt] ... ...; -# 32| 0: [LocalVariableDeclExpr] Int32 a -# 32| 0: [TypeMention] int -# 33| 1: [LocalVariableDeclStmt] ... ...; -# 33| 0: [LocalVariableDeclAndInitExpr] Int32 b = ... -# 33| -1: [TypeMention] int -# 33| 0: [LocalVariableAccess] access to local variable b -# 33| 1: [IntLiteral] 2 -# 33| 1: [LocalVariableDeclAndInitExpr] Int32 c = ... -# 33| -1: [TypeMention] int -# 33| 0: [LocalVariableAccess] access to local variable c -# 33| 1: [IntLiteral] 3 -# 34| 2: [ExprStmt] ...; -# 34| 0: [AssignExpr] ... = ... -# 34| 0: [LocalVariableAccess] access to local variable a -# 34| 1: [IntLiteral] 1 -# 35| 3: [ExprStmt] ...; -# 35| 0: [MethodCall] call to method WriteLine -# 35| -1: [TypeAccess] access to type Console -# 35| 0: [TypeMention] Console -# 35| 0: [AddExpr] ... + ... -# 35| 0: [AddExpr] ... + ... -# 35| 0: [LocalVariableAccess] access to local variable a -# 35| 1: [LocalVariableAccess] access to local variable b -# 35| 1: [LocalVariableAccess] access to local variable c -# 36| 4: [LocalVariableDeclStmt] ... ...; -# 36| 0: [LocalVariableDeclAndInitExpr] Int32 x = ... -# 36| -1: [TypeMention] int -# 36| 0: [LocalVariableAccess] access to local variable x -# 36| 1: [IntLiteral] 45 -# 37| 5: [LocalVariableDeclStmt] ... ...; -# 37| 0: [LocalVariableDeclAndInitExpr] String y = ... -# 37| -1: [TypeMention] string -# 37| 0: [LocalVariableAccess] access to local variable y -# 37| 1: [StringLiteralUtf16] "test" -# 40| 8: [Method] MainLocalConstDecl -# 40| -1: [TypeMention] Void -# 41| 4: [BlockStmt] {...} -# 42| 0: [LocalConstantDeclStmt] const ... ...; -# 42| 0: [LocalVariableDeclAndInitExpr] Single pi = ... -# 42| -1: [TypeMention] float -# 42| 0: [LocalVariableAccess] access to local variable pi -# 42| 1: [FloatLiteral] 3.1415927 -# 43| 1: [LocalConstantDeclStmt] const ... ...; -# 43| 0: [LocalVariableDeclAndInitExpr] Int32 r = ... -# 43| -1: [TypeMention] int -# 43| 0: [LocalVariableAccess] access to local variable r -# 43| 1: [AddExpr] ... + ... -# 43| 0: [IntLiteral] 5 -# 43| 1: [IntLiteral] 20 -# 44| 2: [ExprStmt] ...; -# 44| 0: [MethodCall] call to method WriteLine -# 44| -1: [TypeAccess] access to type Console -# 44| 0: [TypeMention] Console -# 44| 0: [MulExpr] ... * ... -# 44| 0: [MulExpr] ... * ... -# 44| 0: [LocalVariableAccess] access to local variable pi -# 44| 1: [CastExpr] (...) ... -# 44| 1: [LocalVariableAccess] access to local variable r -# 44| 1: [CastExpr] (...) ... -# 44| 1: [LocalVariableAccess] access to local variable r -# 47| 9: [Method] MainExpr -# 47| -1: [TypeMention] Void -# 48| 4: [BlockStmt] {...} -# 49| 0: [LocalVariableDeclStmt] ... ...; -# 49| 0: [LocalVariableDeclExpr] Int32 i -# 49| 0: [TypeMention] int -# 50| 1: [ExprStmt] ...; -# 50| 0: [AssignExpr] ... = ... -# 50| 0: [LocalVariableAccess] access to local variable i -# 50| 1: [IntLiteral] 123 -# 51| 2: [ExprStmt] ...; -# 51| 0: [MethodCall] call to method WriteLine -# 51| -1: [TypeAccess] access to type Console -# 51| 0: [TypeMention] Console +# 6| [NamespaceDeclaration] namespace ... { ... } +# 8| 1: [Class] Class +# 11| 5: [Method] Main +# 11| -1: [TypeMention] Void +# 12| 4: [BlockStmt] {...} +# 13| 0: [LabelStmt] block: +# 14| 1: [BlockStmt] {...} +# 15| 0: [BlockStmt] {...} +# 17| 1: [BlockStmt] {...} +# 18| 0: [BlockStmt] {...} +# 24| 6: [Method] MainEmpty +# 24| -1: [TypeMention] Void +# 25| 4: [BlockStmt] {...} +# 26| 0: [LocalVariableDeclStmt] ... ...; +# 26| 0: [LocalVariableDeclAndInitExpr] Class c = ... +# 26| -1: [TypeMention] Class +# 26| 0: [LocalVariableAccess] access to local variable c +# 26| 1: [ObjectCreation] object creation of type Class +# 26| 0: [TypeMention] Class +# 27| 1: [EmptyStmt] ; +# 27| 2: [EmptyStmt] ; +# 27| 3: [EmptyStmt] ; +# 28| 4: [IfStmt] if (...) ... +# 28| 0: [BoolLiteral] true +# 28| 1: [EmptyStmt] ; +# 31| 7: [Method] MainLocalVarDecl +# 31| -1: [TypeMention] Void +# 32| 4: [BlockStmt] {...} +# 33| 0: [LocalVariableDeclStmt] ... ...; +# 33| 0: [LocalVariableDeclExpr] Int32 a +# 33| 0: [TypeMention] int +# 34| 1: [LocalVariableDeclStmt] ... ...; +# 34| 0: [LocalVariableDeclAndInitExpr] Int32 b = ... +# 34| -1: [TypeMention] int +# 34| 0: [LocalVariableAccess] access to local variable b +# 34| 1: [IntLiteral] 2 +# 34| 1: [LocalVariableDeclAndInitExpr] Int32 c = ... +# 34| -1: [TypeMention] int +# 34| 0: [LocalVariableAccess] access to local variable c +# 34| 1: [IntLiteral] 3 +# 35| 2: [ExprStmt] ...; +# 35| 0: [AssignExpr] ... = ... +# 35| 0: [LocalVariableAccess] access to local variable a +# 35| 1: [IntLiteral] 1 +# 36| 3: [ExprStmt] ...; +# 36| 0: [MethodCall] call to method WriteLine +# 36| -1: [TypeAccess] access to type Console +# 36| 0: [TypeMention] Console +# 36| 0: [AddExpr] ... + ... +# 36| 0: [AddExpr] ... + ... +# 36| 0: [LocalVariableAccess] access to local variable a +# 36| 1: [LocalVariableAccess] access to local variable b +# 36| 1: [LocalVariableAccess] access to local variable c +# 37| 4: [LocalVariableDeclStmt] ... ...; +# 37| 0: [LocalVariableDeclAndInitExpr] Int32 x = ... +# 37| -1: [TypeMention] int +# 37| 0: [LocalVariableAccess] access to local variable x +# 37| 1: [IntLiteral] 45 +# 38| 5: [LocalVariableDeclStmt] ... ...; +# 38| 0: [LocalVariableDeclAndInitExpr] String y = ... +# 38| -1: [TypeMention] string +# 38| 0: [LocalVariableAccess] access to local variable y +# 38| 1: [StringLiteralUtf16] "test" +# 41| 8: [Method] MainLocalConstDecl +# 41| -1: [TypeMention] Void +# 42| 4: [BlockStmt] {...} +# 43| 0: [LocalConstantDeclStmt] const ... ...; +# 43| 0: [LocalVariableDeclAndInitExpr] Single pi = ... +# 43| -1: [TypeMention] float +# 43| 0: [LocalVariableAccess] access to local variable pi +# 43| 1: [FloatLiteral] 3.1415927 +# 44| 1: [LocalConstantDeclStmt] const ... ...; +# 44| 0: [LocalVariableDeclAndInitExpr] Int32 r = ... +# 44| -1: [TypeMention] int +# 44| 0: [LocalVariableAccess] access to local variable r +# 44| 1: [AddExpr] ... + ... +# 44| 0: [IntLiteral] 5 +# 44| 1: [IntLiteral] 20 +# 45| 2: [ExprStmt] ...; +# 45| 0: [MethodCall] call to method WriteLine +# 45| -1: [TypeAccess] access to type Console +# 45| 0: [TypeMention] Console +# 45| 0: [MulExpr] ... * ... +# 45| 0: [MulExpr] ... * ... +# 45| 0: [LocalVariableAccess] access to local variable pi +# 45| 1: [CastExpr] (...) ... +# 45| 1: [LocalVariableAccess] access to local variable r +# 45| 1: [CastExpr] (...) ... +# 45| 1: [LocalVariableAccess] access to local variable r +# 48| 9: [Method] MainExpr +# 48| -1: [TypeMention] Void +# 49| 4: [BlockStmt] {...} +# 50| 0: [LocalVariableDeclStmt] ... ...; +# 50| 0: [LocalVariableDeclExpr] Int32 i +# 50| 0: [TypeMention] int +# 51| 1: [ExprStmt] ...; +# 51| 0: [AssignExpr] ... = ... # 51| 0: [LocalVariableAccess] access to local variable i -# 52| 3: [ExprStmt] ...; -# 52| 0: [PostIncrExpr] ...++ +# 51| 1: [IntLiteral] 123 +# 52| 2: [ExprStmt] ...; +# 52| 0: [MethodCall] call to method WriteLine +# 52| -1: [TypeAccess] access to type Console +# 52| 0: [TypeMention] Console # 52| 0: [LocalVariableAccess] access to local variable i -# 53| 4: [ExprStmt] ...; -# 53| 0: [MethodCall] call to method WriteLine -# 53| -1: [TypeAccess] access to type Console -# 53| 0: [TypeMention] Console +# 53| 3: [ExprStmt] ...; +# 53| 0: [PostIncrExpr] ...++ # 53| 0: [LocalVariableAccess] access to local variable i -# 56| 10: [Method] MainIf -# 56| -1: [TypeMention] Void +# 54| 4: [ExprStmt] ...; +# 54| 0: [MethodCall] call to method WriteLine +# 54| -1: [TypeAccess] access to type Console +# 54| 0: [TypeMention] Console +# 54| 0: [LocalVariableAccess] access to local variable i +# 57| 10: [Method] MainIf +# 57| -1: [TypeMention] Void #-----| 2: (Parameters) -# 56| 0: [Parameter] args -# 56| -1: [TypeMention] String[] -# 56| 1: [TypeMention] string -# 57| 4: [BlockStmt] {...} -# 58| 0: [IfStmt] if (...) ... -# 58| 0: [EQExpr] ... == ... -# 58| 0: [PropertyCall] access to property Length -# 58| -1: [ParameterAccess] access to parameter args -# 58| 1: [IntLiteral] 0 -# 59| 1: [BlockStmt] {...} -# 60| 0: [ExprStmt] ...; -# 60| 0: [MethodCall] call to method WriteLine -# 60| -1: [TypeAccess] access to type Console -# 60| 0: [TypeMention] Console -# 60| 0: [StringLiteralUtf16] "No arguments" -# 63| 2: [BlockStmt] {...} -# 64| 0: [ExprStmt] ...; -# 64| 0: [MethodCall] call to method WriteLine -# 64| -1: [TypeAccess] access to type Console -# 64| 0: [TypeMention] Console -# 64| 0: [StringLiteralUtf16] "One or more arguments" -# 68| 11: [Method] MainSwitch -# 68| -1: [TypeMention] Void +# 57| 0: [Parameter] args +# 57| -1: [TypeMention] String[] +# 57| 1: [TypeMention] string +# 58| 4: [BlockStmt] {...} +# 59| 0: [IfStmt] if (...) ... +# 59| 0: [EQExpr] ... == ... +# 59| 0: [PropertyCall] access to property Length +# 59| -1: [ParameterAccess] access to parameter args +# 59| 1: [IntLiteral] 0 +# 60| 1: [BlockStmt] {...} +# 61| 0: [ExprStmt] ...; +# 61| 0: [MethodCall] call to method WriteLine +# 61| -1: [TypeAccess] access to type Console +# 61| 0: [TypeMention] Console +# 61| 0: [StringLiteralUtf16] "No arguments" +# 64| 2: [BlockStmt] {...} +# 65| 0: [ExprStmt] ...; +# 65| 0: [MethodCall] call to method WriteLine +# 65| -1: [TypeAccess] access to type Console +# 65| 0: [TypeMention] Console +# 65| 0: [StringLiteralUtf16] "One or more arguments" +# 69| 11: [Method] MainSwitch +# 69| -1: [TypeMention] Void #-----| 2: (Parameters) -# 68| 0: [Parameter] args -# 68| -1: [TypeMention] String[] -# 68| 1: [TypeMention] string -# 69| 4: [BlockStmt] {...} -# 70| 0: [LocalVariableDeclStmt] ... ...; -# 70| 0: [LocalVariableDeclAndInitExpr] Int32 n = ... -# 70| -1: [TypeMention] int -# 70| 0: [LocalVariableAccess] access to local variable n -# 70| 1: [PropertyCall] access to property Length -# 70| -1: [ParameterAccess] access to parameter args -# 71| 1: [SwitchStmt] switch (...) {...} -# 71| 0: [LocalVariableAccess] access to local variable n -# 73| 0: [ConstCase] case ...: -# 73| 0: [ConstantPatternExpr,IntLiteral] 0 -# 74| 1: [ExprStmt] ...; -# 74| 0: [MethodCall] call to method WriteLine -# 74| -1: [TypeAccess] access to type Console -# 74| 0: [TypeMention] Console -# 74| 0: [StringLiteralUtf16] "No arguments" -# 75| 2: [BreakStmt] break; -# 76| 3: [ConstCase] case ...: -# 76| 0: [ConstantPatternExpr,IntLiteral] 1 -# 77| 4: [ExprStmt] ...; -# 77| 0: [MethodCall] call to method WriteLine -# 77| -1: [TypeAccess] access to type Console -# 77| 0: [TypeMention] Console -# 77| 0: [StringLiteralUtf16] "One argument" -# 78| 5: [BreakStmt] break; -# 79| 6: [DefaultCase] default: -# 80| 7: [ExprStmt] ...; -# 80| 0: [MethodCall] call to method WriteLine -# 80| -1: [TypeAccess] access to type Console -# 80| 0: [TypeMention] Console -# 80| 0: [StringLiteralUtf16] "{0} arguments" -# 80| 1: [CastExpr] (...) ... -# 80| 1: [LocalVariableAccess] access to local variable n -# 81| 8: [BreakStmt] break; -# 85| 12: [Method] StringSwitch -# 85| -1: [TypeMention] int +# 69| 0: [Parameter] args +# 69| -1: [TypeMention] String[] +# 69| 1: [TypeMention] string +# 70| 4: [BlockStmt] {...} +# 71| 0: [LocalVariableDeclStmt] ... ...; +# 71| 0: [LocalVariableDeclAndInitExpr] Int32 n = ... +# 71| -1: [TypeMention] int +# 71| 0: [LocalVariableAccess] access to local variable n +# 71| 1: [PropertyCall] access to property Length +# 71| -1: [ParameterAccess] access to parameter args +# 72| 1: [SwitchStmt] switch (...) {...} +# 72| 0: [LocalVariableAccess] access to local variable n +# 74| 0: [ConstCase] case ...: +# 74| 0: [ConstantPatternExpr,IntLiteral] 0 +# 75| 1: [ExprStmt] ...; +# 75| 0: [MethodCall] call to method WriteLine +# 75| -1: [TypeAccess] access to type Console +# 75| 0: [TypeMention] Console +# 75| 0: [StringLiteralUtf16] "No arguments" +# 76| 2: [BreakStmt] break; +# 77| 3: [ConstCase] case ...: +# 77| 0: [ConstantPatternExpr,IntLiteral] 1 +# 78| 4: [ExprStmt] ...; +# 78| 0: [MethodCall] call to method WriteLine +# 78| -1: [TypeAccess] access to type Console +# 78| 0: [TypeMention] Console +# 78| 0: [StringLiteralUtf16] "One argument" +# 79| 5: [BreakStmt] break; +# 80| 6: [DefaultCase] default: +# 81| 7: [ExprStmt] ...; +# 81| 0: [MethodCall] call to method WriteLine +# 81| -1: [TypeAccess] access to type Console +# 81| 0: [TypeMention] Console +# 81| 0: [StringLiteralUtf16] "{0} arguments" +# 81| 1: [CastExpr] (...) ... +# 81| 1: [LocalVariableAccess] access to local variable n +# 82| 8: [BreakStmt] break; +# 86| 12: [Method] StringSwitch +# 86| -1: [TypeMention] int #-----| 2: (Parameters) -# 85| 0: [Parameter] foo -# 85| -1: [TypeMention] string -# 86| 4: [BlockStmt] {...} -# 87| 0: [SwitchStmt] switch (...) {...} -# 87| 0: [ParameterAccess] access to parameter foo -# 89| 0: [ConstCase] case ...: -# 89| 0: [ConstantPatternExpr,StringLiteralUtf16] "black" -# 90| 1: [ReturnStmt] return ...; -# 90| 0: [IntLiteral] 0 -# 91| 2: [ConstCase] case ...: -# 91| 0: [ConstantPatternExpr,StringLiteralUtf16] "red" -# 92| 3: [ReturnStmt] return ...; -# 92| 0: [IntLiteral] 1 -# 93| 4: [ConstCase] case ...: -# 93| 0: [ConstantPatternExpr,StringLiteralUtf16] "green" -# 94| 5: [ReturnStmt] return ...; -# 94| 0: [IntLiteral] 2 -# 95| 6: [ConstCase] case ...: -# 95| 0: [ConstantPatternExpr,StringLiteralUtf16] "yellow" -# 96| 7: [ReturnStmt] return ...; -# 96| 0: [IntLiteral] 3 -# 97| 8: [ConstCase] case ...: -# 97| 0: [ConstantPatternExpr,StringLiteralUtf16] "blue" -# 98| 9: [ReturnStmt] return ...; -# 98| 0: [IntLiteral] 4 -# 99| 10: [ConstCase] case ...: -# 99| 0: [ConstantPatternExpr,StringLiteralUtf16] "magenta" -# 100| 11: [ReturnStmt] return ...; -# 100| 0: [IntLiteral] 5 -# 101| 12: [ConstCase] case ...: -# 101| 0: [ConstantPatternExpr,StringLiteralUtf16] "cyan" -# 102| 13: [ReturnStmt] return ...; -# 102| 0: [IntLiteral] 6 -# 103| 14: [ConstCase] case ...: -# 103| 0: [ConstantPatternExpr,StringLiteralUtf16] "grey" -# 104| 15: [ConstCase] case ...: -# 104| 0: [ConstantPatternExpr,StringLiteralUtf16] "white" -# 105| 16: [ReturnStmt] return ...; -# 105| 0: [IntLiteral] 7 -# 107| 1: [ReturnStmt] return ...; -# 107| 0: [IntLiteral] 7 -# 110| 13: [Method] MainWhile -# 110| -1: [TypeMention] Void +# 86| 0: [Parameter] foo +# 86| -1: [TypeMention] string +# 87| 4: [BlockStmt] {...} +# 88| 0: [SwitchStmt] switch (...) {...} +# 88| 0: [ParameterAccess] access to parameter foo +# 90| 0: [ConstCase] case ...: +# 90| 0: [ConstantPatternExpr,StringLiteralUtf16] "black" +# 91| 1: [ReturnStmt] return ...; +# 91| 0: [IntLiteral] 0 +# 92| 2: [ConstCase] case ...: +# 92| 0: [ConstantPatternExpr,StringLiteralUtf16] "red" +# 93| 3: [ReturnStmt] return ...; +# 93| 0: [IntLiteral] 1 +# 94| 4: [ConstCase] case ...: +# 94| 0: [ConstantPatternExpr,StringLiteralUtf16] "green" +# 95| 5: [ReturnStmt] return ...; +# 95| 0: [IntLiteral] 2 +# 96| 6: [ConstCase] case ...: +# 96| 0: [ConstantPatternExpr,StringLiteralUtf16] "yellow" +# 97| 7: [ReturnStmt] return ...; +# 97| 0: [IntLiteral] 3 +# 98| 8: [ConstCase] case ...: +# 98| 0: [ConstantPatternExpr,StringLiteralUtf16] "blue" +# 99| 9: [ReturnStmt] return ...; +# 99| 0: [IntLiteral] 4 +# 100| 10: [ConstCase] case ...: +# 100| 0: [ConstantPatternExpr,StringLiteralUtf16] "magenta" +# 101| 11: [ReturnStmt] return ...; +# 101| 0: [IntLiteral] 5 +# 102| 12: [ConstCase] case ...: +# 102| 0: [ConstantPatternExpr,StringLiteralUtf16] "cyan" +# 103| 13: [ReturnStmt] return ...; +# 103| 0: [IntLiteral] 6 +# 104| 14: [ConstCase] case ...: +# 104| 0: [ConstantPatternExpr,StringLiteralUtf16] "grey" +# 105| 15: [ConstCase] case ...: +# 105| 0: [ConstantPatternExpr,StringLiteralUtf16] "white" +# 106| 16: [ReturnStmt] return ...; +# 106| 0: [IntLiteral] 7 +# 108| 1: [ReturnStmt] return ...; +# 108| 0: [IntLiteral] 7 +# 111| 13: [Method] MainWhile +# 111| -1: [TypeMention] Void #-----| 2: (Parameters) -# 110| 0: [Parameter] args -# 110| -1: [TypeMention] String[] -# 110| 1: [TypeMention] string -# 111| 4: [BlockStmt] {...} -# 112| 0: [LocalVariableDeclStmt] ... ...; -# 112| 0: [LocalVariableDeclAndInitExpr] Int32 i = ... -# 112| -1: [TypeMention] int -# 112| 0: [LocalVariableAccess] access to local variable i -# 112| 1: [IntLiteral] 0 -# 113| 1: [WhileStmt] while (...) ... -# 113| 0: [LTExpr] ... < ... +# 111| 0: [Parameter] args +# 111| -1: [TypeMention] String[] +# 111| 1: [TypeMention] string +# 112| 4: [BlockStmt] {...} +# 113| 0: [LocalVariableDeclStmt] ... ...; +# 113| 0: [LocalVariableDeclAndInitExpr] Int32 i = ... +# 113| -1: [TypeMention] int # 113| 0: [LocalVariableAccess] access to local variable i -# 113| 1: [PropertyCall] access to property Length -# 113| -1: [ParameterAccess] access to parameter args -# 114| 1: [BlockStmt] {...} -# 115| 0: [ExprStmt] ...; -# 115| 0: [MethodCall] call to method WriteLine -# 115| -1: [TypeAccess] access to type Console -# 115| 0: [TypeMention] Console -# 115| 0: [ArrayAccess] access to array element -# 115| -1: [ParameterAccess] access to parameter args -# 115| 0: [LocalVariableAccess] access to local variable i -# 116| 1: [ExprStmt] ...; -# 116| 0: [PostIncrExpr] ...++ -# 116| 0: [LocalVariableAccess] access to local variable i -# 120| 14: [Method] MainDo -# 120| -1: [TypeMention] Void -# 121| 4: [BlockStmt] {...} -# 122| 0: [LocalVariableDeclStmt] ... ...; -# 122| 0: [LocalVariableDeclExpr] String s -# 122| 0: [TypeMention] string -# 123| 1: [DoStmt] do ... while (...); -# 127| 0: [NEExpr] ... != ... -# 127| 0: [LocalVariableAccess] access to local variable s -# 127| 1: [NullLiteral] null -# 124| 1: [BlockStmt] {...} -# 125| 0: [ExprStmt] ...; -# 125| 0: [AssignExpr] ... = ... -# 125| 0: [LocalVariableAccess] access to local variable s -# 125| 1: [MethodCall] call to method ReadLine -# 125| -1: [TypeAccess] access to type Console -# 125| 0: [TypeMention] Console -# 126| 1: [IfStmt] if (...) ... -# 126| 0: [NEExpr] ... != ... +# 113| 1: [IntLiteral] 0 +# 114| 1: [WhileStmt] while (...) ... +# 114| 0: [LTExpr] ... < ... +# 114| 0: [LocalVariableAccess] access to local variable i +# 114| 1: [PropertyCall] access to property Length +# 114| -1: [ParameterAccess] access to parameter args +# 115| 1: [BlockStmt] {...} +# 116| 0: [ExprStmt] ...; +# 116| 0: [MethodCall] call to method WriteLine +# 116| -1: [TypeAccess] access to type Console +# 116| 0: [TypeMention] Console +# 116| 0: [ArrayAccess] access to array element +# 116| -1: [ParameterAccess] access to parameter args +# 116| 0: [LocalVariableAccess] access to local variable i +# 117| 1: [ExprStmt] ...; +# 117| 0: [PostIncrExpr] ...++ +# 117| 0: [LocalVariableAccess] access to local variable i +# 121| 14: [Method] MainDo +# 121| -1: [TypeMention] Void +# 122| 4: [BlockStmt] {...} +# 123| 0: [LocalVariableDeclStmt] ... ...; +# 123| 0: [LocalVariableDeclExpr] String s +# 123| 0: [TypeMention] string +# 124| 1: [DoStmt] do ... while (...); +# 128| 0: [NEExpr] ... != ... +# 128| 0: [LocalVariableAccess] access to local variable s +# 128| 1: [NullLiteral] null +# 125| 1: [BlockStmt] {...} +# 126| 0: [ExprStmt] ...; +# 126| 0: [AssignExpr] ... = ... # 126| 0: [LocalVariableAccess] access to local variable s -# 126| 1: [NullLiteral] null -# 126| 1: [ExprStmt] ...; -# 126| 0: [MethodCall] call to method WriteLine +# 126| 1: [MethodCall] call to method ReadLine # 126| -1: [TypeAccess] access to type Console # 126| 0: [TypeMention] Console -# 126| 0: [LocalVariableAccess] access to local variable s -# 130| 15: [Method] MainFor -# 130| -1: [TypeMention] Void +# 127| 1: [IfStmt] if (...) ... +# 127| 0: [NEExpr] ... != ... +# 127| 0: [LocalVariableAccess] access to local variable s +# 127| 1: [NullLiteral] null +# 127| 1: [ExprStmt] ...; +# 127| 0: [MethodCall] call to method WriteLine +# 127| -1: [TypeAccess] access to type Console +# 127| 0: [TypeMention] Console +# 127| 0: [LocalVariableAccess] access to local variable s +# 131| 15: [Method] MainFor +# 131| -1: [TypeMention] Void #-----| 2: (Parameters) -# 130| 0: [Parameter] args -# 130| -1: [TypeMention] String[] -# 130| 1: [TypeMention] string -# 131| 4: [BlockStmt] {...} -# 132| 0: [ForStmt] for (...;...;...) ... -# 132| -1: [LocalVariableDeclAndInitExpr] Int32 i = ... -# 132| -1: [TypeMention] int -# 132| 0: [LocalVariableAccess] access to local variable i -# 132| 1: [IntLiteral] 0 -# 132| 0: [LTExpr] ... < ... -# 132| 0: [LocalVariableAccess] access to local variable i -# 132| 1: [PropertyCall] access to property Length -# 132| -1: [ParameterAccess] access to parameter args -# 132| 1: [PostIncrExpr] ...++ -# 132| 0: [LocalVariableAccess] access to local variable i -# 133| 2: [BlockStmt] {...} -# 134| 0: [ExprStmt] ...; -# 134| 0: [MethodCall] call to method WriteLine -# 134| -1: [TypeAccess] access to type Console -# 134| 0: [TypeMention] Console -# 134| 0: [ArrayAccess] access to array element -# 134| -1: [ParameterAccess] access to parameter args -# 134| 0: [LocalVariableAccess] access to local variable i -# 138| 16: [Method] MainForeach -# 138| -1: [TypeMention] Void +# 131| 0: [Parameter] args +# 131| -1: [TypeMention] String[] +# 131| 1: [TypeMention] string +# 132| 4: [BlockStmt] {...} +# 133| 0: [ForStmt] for (...;...;...) ... +# 133| -1: [LocalVariableDeclAndInitExpr] Int32 i = ... +# 133| -1: [TypeMention] int +# 133| 0: [LocalVariableAccess] access to local variable i +# 133| 1: [IntLiteral] 0 +# 133| 0: [LTExpr] ... < ... +# 133| 0: [LocalVariableAccess] access to local variable i +# 133| 1: [PropertyCall] access to property Length +# 133| -1: [ParameterAccess] access to parameter args +# 133| 1: [PostIncrExpr] ...++ +# 133| 0: [LocalVariableAccess] access to local variable i +# 134| 2: [BlockStmt] {...} +# 135| 0: [ExprStmt] ...; +# 135| 0: [MethodCall] call to method WriteLine +# 135| -1: [TypeAccess] access to type Console +# 135| 0: [TypeMention] Console +# 135| 0: [ArrayAccess] access to array element +# 135| -1: [ParameterAccess] access to parameter args +# 135| 0: [LocalVariableAccess] access to local variable i +# 139| 16: [Method] MainForeach +# 139| -1: [TypeMention] Void #-----| 2: (Parameters) -# 138| 0: [Parameter] args -# 138| -1: [TypeMention] String[] -# 138| 1: [TypeMention] string -# 139| 4: [BlockStmt] {...} -# 140| 0: [ForeachStmt] foreach (... ... in ...) ... -# 140| 0: [LocalVariableDeclExpr] String s -# 140| 0: [TypeMention] string -# 140| 1: [ParameterAccess] access to parameter args -# 141| 2: [BlockStmt] {...} -# 142| 0: [ExprStmt] ...; -# 142| 0: [MethodCall] call to method WriteLine -# 142| -1: [TypeAccess] access to type Console -# 142| 0: [TypeMention] Console -# 142| 0: [LocalVariableAccess] access to local variable s -# 146| 17: [Method] MainBreak -# 146| -1: [TypeMention] Void -# 147| 4: [BlockStmt] {...} -# 148| 0: [WhileStmt] while (...) ... -# 148| 0: [BoolLiteral] true -# 149| 1: [BlockStmt] {...} -# 150| 0: [LocalVariableDeclStmt] ... ...; -# 150| 0: [LocalVariableDeclAndInitExpr] String s = ... -# 150| -1: [TypeMention] string -# 150| 0: [LocalVariableAccess] access to local variable s -# 150| 1: [MethodCall] call to method ReadLine -# 150| -1: [TypeAccess] access to type Console -# 150| 0: [TypeMention] Console -# 151| 1: [IfStmt] if (...) ... -# 151| 0: [EQExpr] ... == ... +# 139| 0: [Parameter] args +# 139| -1: [TypeMention] String[] +# 139| 1: [TypeMention] string +# 140| 4: [BlockStmt] {...} +# 141| 0: [ForeachStmt] foreach (... ... in ...) ... +# 141| 0: [LocalVariableDeclExpr] String s +# 141| 0: [TypeMention] string +# 141| 1: [ParameterAccess] access to parameter args +# 142| 2: [BlockStmt] {...} +# 143| 0: [ExprStmt] ...; +# 143| 0: [MethodCall] call to method WriteLine +# 143| -1: [TypeAccess] access to type Console +# 143| 0: [TypeMention] Console +# 143| 0: [LocalVariableAccess] access to local variable s +# 147| 17: [Method] MainBreak +# 147| -1: [TypeMention] Void +# 148| 4: [BlockStmt] {...} +# 149| 0: [WhileStmt] while (...) ... +# 149| 0: [BoolLiteral] true +# 150| 1: [BlockStmt] {...} +# 151| 0: [LocalVariableDeclStmt] ... ...; +# 151| 0: [LocalVariableDeclAndInitExpr] String s = ... +# 151| -1: [TypeMention] string # 151| 0: [LocalVariableAccess] access to local variable s -# 151| 1: [NullLiteral] null -# 151| 1: [BreakStmt] break; -# 152| 2: [ExprStmt] ...; -# 152| 0: [MethodCall] call to method WriteLine -# 152| -1: [TypeAccess] access to type Console -# 152| 0: [TypeMention] Console +# 151| 1: [MethodCall] call to method ReadLine +# 151| -1: [TypeAccess] access to type Console +# 151| 0: [TypeMention] Console +# 152| 1: [IfStmt] if (...) ... +# 152| 0: [EQExpr] ... == ... # 152| 0: [LocalVariableAccess] access to local variable s -# 156| 18: [Method] MainContinue -# 156| -1: [TypeMention] Void +# 152| 1: [NullLiteral] null +# 152| 1: [BreakStmt] break; +# 153| 2: [ExprStmt] ...; +# 153| 0: [MethodCall] call to method WriteLine +# 153| -1: [TypeAccess] access to type Console +# 153| 0: [TypeMention] Console +# 153| 0: [LocalVariableAccess] access to local variable s +# 157| 18: [Method] MainContinue +# 157| -1: [TypeMention] Void #-----| 2: (Parameters) -# 156| 0: [Parameter] args -# 156| -1: [TypeMention] String[] -# 156| 1: [TypeMention] string -# 157| 4: [BlockStmt] {...} -# 158| 0: [ForStmt] for (...;...;...) ... -# 158| -1: [LocalVariableDeclAndInitExpr] Int32 i = ... -# 158| -1: [TypeMention] int -# 158| 0: [LocalVariableAccess] access to local variable i -# 158| 1: [IntLiteral] 0 -# 158| 0: [LTExpr] ... < ... -# 158| 0: [LocalVariableAccess] access to local variable i -# 158| 1: [PropertyCall] access to property Length -# 158| -1: [ParameterAccess] access to parameter args -# 158| 1: [PostIncrExpr] ...++ -# 158| 0: [LocalVariableAccess] access to local variable i -# 159| 2: [BlockStmt] {...} -# 160| 0: [IfStmt] if (...) ... -# 160| 0: [MethodCall] call to method StartsWith -# 160| -1: [ArrayAccess] access to array element -# 160| -1: [ParameterAccess] access to parameter args -# 160| 0: [LocalVariableAccess] access to local variable i -# 160| 0: [StringLiteralUtf16] "/" -# 160| 1: [ContinueStmt] continue; -# 161| 1: [ExprStmt] ...; -# 161| 0: [MethodCall] call to method WriteLine -# 161| -1: [TypeAccess] access to type Console -# 161| 0: [TypeMention] Console -# 161| 0: [ArrayAccess] access to array element +# 157| 0: [Parameter] args +# 157| -1: [TypeMention] String[] +# 157| 1: [TypeMention] string +# 158| 4: [BlockStmt] {...} +# 159| 0: [ForStmt] for (...;...;...) ... +# 159| -1: [LocalVariableDeclAndInitExpr] Int32 i = ... +# 159| -1: [TypeMention] int +# 159| 0: [LocalVariableAccess] access to local variable i +# 159| 1: [IntLiteral] 0 +# 159| 0: [LTExpr] ... < ... +# 159| 0: [LocalVariableAccess] access to local variable i +# 159| 1: [PropertyCall] access to property Length +# 159| -1: [ParameterAccess] access to parameter args +# 159| 1: [PostIncrExpr] ...++ +# 159| 0: [LocalVariableAccess] access to local variable i +# 160| 2: [BlockStmt] {...} +# 161| 0: [IfStmt] if (...) ... +# 161| 0: [MethodCall] call to method StartsWith +# 161| -1: [ArrayAccess] access to array element # 161| -1: [ParameterAccess] access to parameter args # 161| 0: [LocalVariableAccess] access to local variable i -# 165| 19: [Method] MainGoto -# 165| -1: [TypeMention] Void +# 161| 0: [StringLiteralUtf16] "/" +# 161| 1: [ContinueStmt] continue; +# 162| 1: [ExprStmt] ...; +# 162| 0: [MethodCall] call to method WriteLine +# 162| -1: [TypeAccess] access to type Console +# 162| 0: [TypeMention] Console +# 162| 0: [ArrayAccess] access to array element +# 162| -1: [ParameterAccess] access to parameter args +# 162| 0: [LocalVariableAccess] access to local variable i +# 166| 19: [Method] MainGoto +# 166| -1: [TypeMention] Void #-----| 2: (Parameters) -# 165| 0: [Parameter] args -# 165| -1: [TypeMention] String[] -# 165| 1: [TypeMention] string -# 166| 4: [BlockStmt] {...} -# 167| 0: [LocalVariableDeclStmt] ... ...; -# 167| 0: [LocalVariableDeclAndInitExpr] Int32 i = ... -# 167| -1: [TypeMention] int -# 167| 0: [LocalVariableAccess] access to local variable i -# 167| 1: [IntLiteral] 0 -# 168| 1: [GotoLabelStmt] goto ...; -# 169| 2: [LabelStmt] loop: -# 169| 3: [ExprStmt] ...; -# 169| 0: [MethodCall] call to method WriteLine -# 169| -1: [TypeAccess] access to type Console -# 169| 0: [TypeMention] Console -# 169| 0: [ArrayAccess] access to array element -# 169| -1: [ParameterAccess] access to parameter args -# 169| 0: [PostIncrExpr] ...++ -# 169| 0: [LocalVariableAccess] access to local variable i -# 170| 4: [LabelStmt] check: -# 170| 5: [IfStmt] if (...) ... -# 170| 0: [LTExpr] ... < ... -# 170| 0: [LocalVariableAccess] access to local variable i -# 170| 1: [PropertyCall] access to property Length +# 166| 0: [Parameter] args +# 166| -1: [TypeMention] String[] +# 166| 1: [TypeMention] string +# 167| 4: [BlockStmt] {...} +# 168| 0: [LocalVariableDeclStmt] ... ...; +# 168| 0: [LocalVariableDeclAndInitExpr] Int32 i = ... +# 168| -1: [TypeMention] int +# 168| 0: [LocalVariableAccess] access to local variable i +# 168| 1: [IntLiteral] 0 +# 169| 1: [GotoLabelStmt] goto ...; +# 170| 2: [LabelStmt] loop: +# 170| 3: [ExprStmt] ...; +# 170| 0: [MethodCall] call to method WriteLine +# 170| -1: [TypeAccess] access to type Console +# 170| 0: [TypeMention] Console +# 170| 0: [ArrayAccess] access to array element # 170| -1: [ParameterAccess] access to parameter args -# 170| 1: [GotoLabelStmt] goto ...; -# 173| 20: [Method] Add -# 173| -1: [TypeMention] int +# 170| 0: [PostIncrExpr] ...++ +# 170| 0: [LocalVariableAccess] access to local variable i +# 171| 4: [LabelStmt] check: +# 171| 5: [IfStmt] if (...) ... +# 171| 0: [LTExpr] ... < ... +# 171| 0: [LocalVariableAccess] access to local variable i +# 171| 1: [PropertyCall] access to property Length +# 171| -1: [ParameterAccess] access to parameter args +# 171| 1: [GotoLabelStmt] goto ...; +# 174| 20: [Method] Add +# 174| -1: [TypeMention] int #-----| 2: (Parameters) -# 173| 0: [Parameter] a -# 173| -1: [TypeMention] int -# 173| 1: [Parameter] b -# 173| -1: [TypeMention] int -# 174| 4: [BlockStmt] {...} -# 175| 0: [ReturnStmt] return ...; -# 175| 0: [AddExpr] ... + ... -# 175| 0: [ParameterAccess] access to parameter a -# 175| 1: [ParameterAccess] access to parameter b -# 177| 21: [Method] MainReturn -# 177| -1: [TypeMention] Void -# 178| 4: [BlockStmt] {...} -# 179| 0: [ExprStmt] ...; -# 179| 0: [MethodCall] call to method WriteLine -# 179| -1: [TypeAccess] access to type Console -# 179| 0: [TypeMention] Console -# 179| 0: [MethodCall] call to method Add -# 179| 0: [IntLiteral] 1 -# 179| 1: [IntLiteral] 2 -# 180| 1: [ReturnStmt] return ...; -# 183| 22: [Method] Range -# 183| -1: [TypeMention] IEnumerable -# 183| 1: [TypeMention] int +# 174| 0: [Parameter] a +# 174| -1: [TypeMention] int +# 174| 1: [Parameter] b +# 174| -1: [TypeMention] int +# 175| 4: [BlockStmt] {...} +# 176| 0: [ReturnStmt] return ...; +# 176| 0: [AddExpr] ... + ... +# 176| 0: [ParameterAccess] access to parameter a +# 176| 1: [ParameterAccess] access to parameter b +# 178| 21: [Method] MainReturn +# 178| -1: [TypeMention] Void +# 179| 4: [BlockStmt] {...} +# 180| 0: [ExprStmt] ...; +# 180| 0: [MethodCall] call to method WriteLine +# 180| -1: [TypeAccess] access to type Console +# 180| 0: [TypeMention] Console +# 180| 0: [MethodCall] call to method Add +# 180| 0: [IntLiteral] 1 +# 180| 1: [IntLiteral] 2 +# 181| 1: [ReturnStmt] return ...; +# 184| 22: [Method] Range +# 184| -1: [TypeMention] IEnumerable +# 184| 1: [TypeMention] int #-----| 2: (Parameters) -# 183| 0: [Parameter] from -# 183| -1: [TypeMention] int -# 183| 1: [Parameter] to -# 183| -1: [TypeMention] int -# 184| 4: [BlockStmt] {...} -# 185| 0: [ForStmt] for (...;...;...) ... -# 185| -1: [LocalVariableDeclAndInitExpr] Int32 i = ... -# 185| -1: [TypeMention] int -# 185| 0: [LocalVariableAccess] access to local variable i -# 185| 1: [ParameterAccess] access to parameter from -# 185| 0: [LTExpr] ... < ... -# 185| 0: [LocalVariableAccess] access to local variable i -# 185| 1: [ParameterAccess] access to parameter to -# 185| 1: [PostIncrExpr] ...++ -# 185| 0: [LocalVariableAccess] access to local variable i -# 186| 2: [BlockStmt] {...} -# 187| 0: [YieldReturnStmt] yield return ...; -# 187| 0: [LocalVariableAccess] access to local variable i -# 189| 1: [YieldBreakStmt] yield break; -# 191| 23: [Method] MainYield -# 191| -1: [TypeMention] Void -# 192| 4: [BlockStmt] {...} -# 193| 0: [ForeachStmt] foreach (... ... in ...) ... -# 193| 0: [LocalVariableDeclExpr] Int32 x -# 193| 0: [TypeMention] int -# 193| 1: [MethodCall] call to method Range -# 193| 0: [UnaryMinusExpr] -... -# 193| 0: [IntLiteral] 10 -# 193| 1: [IntLiteral] 10 -# 194| 2: [BlockStmt] {...} -# 195| 0: [ExprStmt] ...; -# 195| 0: [MethodCall] call to method WriteLine -# 195| -1: [TypeAccess] access to type Console -# 195| 0: [TypeMention] Console -# 195| 0: [LocalVariableAccess] access to local variable x -# 199| 24: [Method] Divide -# 199| -1: [TypeMention] double +# 184| 0: [Parameter] from +# 184| -1: [TypeMention] int +# 184| 1: [Parameter] to +# 184| -1: [TypeMention] int +# 185| 4: [BlockStmt] {...} +# 186| 0: [ForStmt] for (...;...;...) ... +# 186| -1: [LocalVariableDeclAndInitExpr] Int32 i = ... +# 186| -1: [TypeMention] int +# 186| 0: [LocalVariableAccess] access to local variable i +# 186| 1: [ParameterAccess] access to parameter from +# 186| 0: [LTExpr] ... < ... +# 186| 0: [LocalVariableAccess] access to local variable i +# 186| 1: [ParameterAccess] access to parameter to +# 186| 1: [PostIncrExpr] ...++ +# 186| 0: [LocalVariableAccess] access to local variable i +# 187| 2: [BlockStmt] {...} +# 188| 0: [YieldReturnStmt] yield return ...; +# 188| 0: [LocalVariableAccess] access to local variable i +# 190| 1: [YieldBreakStmt] yield break; +# 192| 23: [Method] MainYield +# 192| -1: [TypeMention] Void +# 193| 4: [BlockStmt] {...} +# 194| 0: [ForeachStmt] foreach (... ... in ...) ... +# 194| 0: [LocalVariableDeclExpr] Int32 x +# 194| 0: [TypeMention] int +# 194| 1: [MethodCall] call to method Range +# 194| 0: [UnaryMinusExpr] -... +# 194| 0: [IntLiteral] 10 +# 194| 1: [IntLiteral] 10 +# 195| 2: [BlockStmt] {...} +# 196| 0: [ExprStmt] ...; +# 196| 0: [MethodCall] call to method WriteLine +# 196| -1: [TypeAccess] access to type Console +# 196| 0: [TypeMention] Console +# 196| 0: [LocalVariableAccess] access to local variable x +# 200| 24: [Method] Divide +# 200| -1: [TypeMention] double #-----| 2: (Parameters) -# 199| 0: [Parameter] x -# 199| -1: [TypeMention] double -# 199| 1: [Parameter] y -# 199| -1: [TypeMention] double -# 200| 4: [BlockStmt] {...} -# 201| 0: [IfStmt] if (...) ... -# 201| 0: [EQExpr] ... == ... -# 201| 0: [ParameterAccess] access to parameter y -# 201| 1: [CastExpr] (...) ... -# 201| 1: [IntLiteral] 0 -# 201| 1: [ThrowStmt] throw ...; -# 201| 0: [ObjectCreation] object creation of type DivideByZeroException -# 201| 0: [TypeMention] DivideByZeroException -# 202| 1: [ReturnStmt] return ...; -# 202| 0: [DivExpr] ... / ... -# 202| 0: [ParameterAccess] access to parameter x -# 202| 1: [ParameterAccess] access to parameter y -# 204| 25: [Method] MainTryThrow -# 204| -1: [TypeMention] Void +# 200| 0: [Parameter] x +# 200| -1: [TypeMention] double +# 200| 1: [Parameter] y +# 200| -1: [TypeMention] double +# 201| 4: [BlockStmt] {...} +# 202| 0: [IfStmt] if (...) ... +# 202| 0: [EQExpr] ... == ... +# 202| 0: [ParameterAccess] access to parameter y +# 202| 1: [CastExpr] (...) ... +# 202| 1: [IntLiteral] 0 +# 202| 1: [ThrowStmt] throw ...; +# 202| 0: [ObjectCreation] object creation of type DivideByZeroException +# 202| 0: [TypeMention] DivideByZeroException +# 203| 1: [ReturnStmt] return ...; +# 203| 0: [DivExpr] ... / ... +# 203| 0: [ParameterAccess] access to parameter x +# 203| 1: [ParameterAccess] access to parameter y +# 205| 25: [Method] MainTryThrow +# 205| -1: [TypeMention] Void #-----| 2: (Parameters) -# 204| 0: [Parameter] args -# 204| -1: [TypeMention] String[] -# 204| 1: [TypeMention] string -# 205| 4: [BlockStmt] {...} -# 206| 0: [TryStmt] try {...} ... -# 225| -1: [BlockStmt] {...} -# 226| 0: [ExprStmt] ...; -# 226| 0: [MethodCall] call to method WriteLine -# 226| -1: [TypeAccess] access to type Console -# 226| 0: [TypeMention] Console -# 226| 0: [StringLiteralUtf16] "Good bye!" -# 207| 0: [BlockStmt] {...} -# 208| 0: [IfStmt] if (...) ... -# 208| 0: [NEExpr] ... != ... -# 208| 0: [PropertyCall] access to property Length -# 208| -1: [ParameterAccess] access to parameter args -# 208| 1: [IntLiteral] 2 -# 209| 1: [BlockStmt] {...} -# 210| 0: [ThrowStmt] throw ...; -# 210| 0: [ObjectCreation] object creation of type Exception -# 210| -1: [TypeMention] Exception -# 210| 0: [StringLiteralUtf16] "Two numbers required" -# 212| 1: [LocalVariableDeclStmt] ... ...; -# 212| 0: [LocalVariableDeclAndInitExpr] Double x = ... -# 212| -1: [TypeMention] double -# 212| 0: [LocalVariableAccess] access to local variable x -# 212| 1: [MethodCall] call to method Parse -# 212| -1: [TypeAccess] access to type Double -# 212| 0: [TypeMention] double -# 212| 0: [ArrayAccess] access to array element -# 212| -1: [ParameterAccess] access to parameter args -# 212| 0: [IntLiteral] 0 -# 213| 2: [LocalVariableDeclStmt] ... ...; -# 213| 0: [LocalVariableDeclAndInitExpr] Double y = ... +# 205| 0: [Parameter] args +# 205| -1: [TypeMention] String[] +# 205| 1: [TypeMention] string +# 206| 4: [BlockStmt] {...} +# 207| 0: [TryStmt] try {...} ... +# 226| -1: [BlockStmt] {...} +# 227| 0: [ExprStmt] ...; +# 227| 0: [MethodCall] call to method WriteLine +# 227| -1: [TypeAccess] access to type Console +# 227| 0: [TypeMention] Console +# 227| 0: [StringLiteralUtf16] "Good bye!" +# 208| 0: [BlockStmt] {...} +# 209| 0: [IfStmt] if (...) ... +# 209| 0: [NEExpr] ... != ... +# 209| 0: [PropertyCall] access to property Length +# 209| -1: [ParameterAccess] access to parameter args +# 209| 1: [IntLiteral] 2 +# 210| 1: [BlockStmt] {...} +# 211| 0: [ThrowStmt] throw ...; +# 211| 0: [ObjectCreation] object creation of type Exception +# 211| -1: [TypeMention] Exception +# 211| 0: [StringLiteralUtf16] "Two numbers required" +# 213| 1: [LocalVariableDeclStmt] ... ...; +# 213| 0: [LocalVariableDeclAndInitExpr] Double x = ... # 213| -1: [TypeMention] double -# 213| 0: [LocalVariableAccess] access to local variable y +# 213| 0: [LocalVariableAccess] access to local variable x # 213| 1: [MethodCall] call to method Parse # 213| -1: [TypeAccess] access to type Double # 213| 0: [TypeMention] double # 213| 0: [ArrayAccess] access to array element # 213| -1: [ParameterAccess] access to parameter args -# 213| 0: [IntLiteral] 1 -# 214| 3: [ExprStmt] ...; -# 214| 0: [MethodCall] call to method WriteLine -# 214| -1: [TypeAccess] access to type Console -# 214| 0: [TypeMention] Console -# 214| 0: [MethodCall] call to method Divide -# 214| 0: [LocalVariableAccess] access to local variable x -# 214| 1: [LocalVariableAccess] access to local variable y -# 216| 1: [SpecificCatchClause] catch (...) {...} -# 216| 0: [LocalVariableDeclExpr] Exception e -# 216| 0: [TypeMention] Exception -# 217| 1: [BlockStmt] {...} -# 218| 0: [ExprStmt] ...; -# 218| 0: [MethodCall] call to method WriteLine -# 218| -1: [TypeAccess] access to type Console -# 218| 0: [TypeMention] Console -# 218| 0: [PropertyCall] access to property Message -# 218| -1: [LocalVariableAccess] access to local variable e -# 220| 2: [GeneralCatchClause] catch {...} -# 221| 1: [BlockStmt] {...} -# 222| 0: [ExprStmt] ...; -# 222| 0: [MethodCall] call to method WriteLine -# 222| -1: [TypeAccess] access to type Console -# 222| 0: [TypeMention] Console -# 222| 0: [StringLiteralUtf16] "Exception" -# 230| 26: [Method] MainCheckedUnchecked -# 230| -1: [TypeMention] Void -# 231| 4: [BlockStmt] {...} -# 232| 0: [LocalVariableDeclStmt] ... ...; -# 232| 0: [LocalVariableDeclAndInitExpr] Int32 i = ... -# 232| -1: [TypeMention] int -# 232| 0: [LocalVariableAccess] access to local variable i -# 232| 1: [MemberConstantAccess] access to constant MaxValue -# 232| -1: [TypeAccess] access to type Int32 -# 232| 0: [TypeMention] int -# 233| 1: [CheckedStmt] checked {...} -# 234| 0: [BlockStmt] {...} -# 235| 0: [ExprStmt] ...; -# 235| 0: [MethodCall] call to method WriteLine -# 235| -1: [TypeAccess] access to type Console -# 235| 0: [TypeMention] Console -# 235| 0: [AddExpr] ... + ... -# 235| 0: [LocalVariableAccess] access to local variable i -# 235| 1: [IntLiteral] 1 -# 237| 2: [UncheckedStmt] unchecked {...} -# 238| 0: [BlockStmt] {...} -# 239| 0: [ExprStmt] ...; -# 239| 0: [MethodCall] call to method WriteLine -# 239| -1: [TypeAccess] access to type Console -# 239| 0: [TypeMention] Console -# 239| 0: [AddExpr] ... + ... -# 239| 0: [LocalVariableAccess] access to local variable i -# 239| 1: [IntLiteral] 1 -# 243| 27: [Class] AccountLock -# 245| 5: [Field] balance -# 245| -1: [TypeMention] decimal -# 246| 6: [Method] Withdraw -# 246| -1: [TypeMention] Void +# 213| 0: [IntLiteral] 0 +# 214| 2: [LocalVariableDeclStmt] ... ...; +# 214| 0: [LocalVariableDeclAndInitExpr] Double y = ... +# 214| -1: [TypeMention] double +# 214| 0: [LocalVariableAccess] access to local variable y +# 214| 1: [MethodCall] call to method Parse +# 214| -1: [TypeAccess] access to type Double +# 214| 0: [TypeMention] double +# 214| 0: [ArrayAccess] access to array element +# 214| -1: [ParameterAccess] access to parameter args +# 214| 0: [IntLiteral] 1 +# 215| 3: [ExprStmt] ...; +# 215| 0: [MethodCall] call to method WriteLine +# 215| -1: [TypeAccess] access to type Console +# 215| 0: [TypeMention] Console +# 215| 0: [MethodCall] call to method Divide +# 215| 0: [LocalVariableAccess] access to local variable x +# 215| 1: [LocalVariableAccess] access to local variable y +# 217| 1: [SpecificCatchClause] catch (...) {...} +# 217| 0: [LocalVariableDeclExpr] Exception e +# 217| 0: [TypeMention] Exception +# 218| 1: [BlockStmt] {...} +# 219| 0: [ExprStmt] ...; +# 219| 0: [MethodCall] call to method WriteLine +# 219| -1: [TypeAccess] access to type Console +# 219| 0: [TypeMention] Console +# 219| 0: [PropertyCall] access to property Message +# 219| -1: [LocalVariableAccess] access to local variable e +# 221| 2: [GeneralCatchClause] catch {...} +# 222| 1: [BlockStmt] {...} +# 223| 0: [ExprStmt] ...; +# 223| 0: [MethodCall] call to method WriteLine +# 223| -1: [TypeAccess] access to type Console +# 223| 0: [TypeMention] Console +# 223| 0: [StringLiteralUtf16] "Exception" +# 231| 26: [Method] MainCheckedUnchecked +# 231| -1: [TypeMention] Void +# 232| 4: [BlockStmt] {...} +# 233| 0: [LocalVariableDeclStmt] ... ...; +# 233| 0: [LocalVariableDeclAndInitExpr] Int32 i = ... +# 233| -1: [TypeMention] int +# 233| 0: [LocalVariableAccess] access to local variable i +# 233| 1: [MemberConstantAccess] access to constant MaxValue +# 233| -1: [TypeAccess] access to type Int32 +# 233| 0: [TypeMention] int +# 234| 1: [CheckedStmt] checked {...} +# 235| 0: [BlockStmt] {...} +# 236| 0: [ExprStmt] ...; +# 236| 0: [MethodCall] call to method WriteLine +# 236| -1: [TypeAccess] access to type Console +# 236| 0: [TypeMention] Console +# 236| 0: [AddExpr] ... + ... +# 236| 0: [LocalVariableAccess] access to local variable i +# 236| 1: [IntLiteral] 1 +# 238| 2: [UncheckedStmt] unchecked {...} +# 239| 0: [BlockStmt] {...} +# 240| 0: [ExprStmt] ...; +# 240| 0: [MethodCall] call to method WriteLine +# 240| -1: [TypeAccess] access to type Console +# 240| 0: [TypeMention] Console +# 240| 0: [AddExpr] ... + ... +# 240| 0: [LocalVariableAccess] access to local variable i +# 240| 1: [IntLiteral] 1 +# 244| 27: [Class] AccountLock +# 246| 5: [Field] balance +# 246| -1: [TypeMention] decimal +# 247| 6: [Method] Withdraw +# 247| -1: [TypeMention] Void #-----| 2: (Parameters) -# 246| 0: [Parameter] amount -# 246| -1: [TypeMention] decimal -# 247| 4: [BlockStmt] {...} -# 248| 0: [LockStmt] lock (...) {...} -# 248| 0: [ThisAccess] this access -# 249| 1: [BlockStmt] {...} -# 250| 0: [IfStmt] if (...) ... -# 250| 0: [GTExpr] ... > ... -# 250| 0: [ParameterAccess] access to parameter amount -# 250| 1: [FieldAccess] access to field balance -# 251| 1: [BlockStmt] {...} -# 252| 0: [ThrowStmt] throw ...; -# 252| 0: [ObjectCreation] object creation of type Exception -# 252| -1: [TypeMention] Exception -# 252| 0: [StringLiteralUtf16] "Insufficient funds" -# 254| 1: [ExprStmt] ...; -# 254| 0: [AssignSubExpr] ... -= ... -# 254| 0: [FieldAccess] access to field balance -# 254| 1: [ParameterAccess] access to parameter amount -# 259| 28: [Method] MainUsing -# 259| -1: [TypeMention] Void -# 260| 4: [BlockStmt] {...} -# 261| 0: [UsingBlockStmt] using (...) {...} -# 261| -1: [LocalVariableDeclAndInitExpr] TextWriter w = ... -# 261| -1: [TypeMention] TextWriter -# 261| 0: [LocalVariableAccess] access to local variable w -# 261| 1: [MethodCall] call to method CreateText -# 261| -1: [TypeAccess] access to type File -# 261| 0: [TypeMention] File -# 261| 0: [StringLiteralUtf16] "test.txt" -# 262| 1: [BlockStmt] {...} -# 263| 0: [ExprStmt] ...; -# 263| 0: [MethodCall] call to method WriteLine -# 263| -1: [LocalVariableAccess] access to local variable w -# 263| 0: [StringLiteralUtf16] "Line one" -# 264| 1: [ExprStmt] ...; +# 247| 0: [Parameter] amount +# 247| -1: [TypeMention] decimal +# 248| 4: [BlockStmt] {...} +# 249| 0: [LockStmt] lock (...) {...} +# 249| 0: [ThisAccess] this access +# 250| 1: [BlockStmt] {...} +# 251| 0: [IfStmt] if (...) ... +# 251| 0: [GTExpr] ... > ... +# 251| 0: [ParameterAccess] access to parameter amount +# 251| 1: [FieldAccess] access to field balance +# 252| 1: [BlockStmt] {...} +# 253| 0: [ThrowStmt] throw ...; +# 253| 0: [ObjectCreation] object creation of type Exception +# 253| -1: [TypeMention] Exception +# 253| 0: [StringLiteralUtf16] "Insufficient funds" +# 255| 1: [ExprStmt] ...; +# 255| 0: [AssignSubExpr] ... -= ... +# 255| 0: [FieldAccess] access to field balance +# 255| 1: [ParameterAccess] access to parameter amount +# 260| 28: [Method] MainUsing +# 260| -1: [TypeMention] Void +# 261| 4: [BlockStmt] {...} +# 262| 0: [UsingBlockStmt] using (...) {...} +# 262| -1: [LocalVariableDeclAndInitExpr] TextWriter w = ... +# 262| -1: [TypeMention] TextWriter +# 262| 0: [LocalVariableAccess] access to local variable w +# 262| 1: [MethodCall] call to method CreateText +# 262| -1: [TypeAccess] access to type File +# 262| 0: [TypeMention] File +# 262| 0: [StringLiteralUtf16] "test.txt" +# 263| 1: [BlockStmt] {...} +# 264| 0: [ExprStmt] ...; # 264| 0: [MethodCall] call to method WriteLine # 264| -1: [LocalVariableAccess] access to local variable w -# 264| 0: [StringLiteralUtf16] "Line two" -# 265| 2: [ExprStmt] ...; +# 264| 0: [StringLiteralUtf16] "Line one" +# 265| 1: [ExprStmt] ...; # 265| 0: [MethodCall] call to method WriteLine # 265| -1: [LocalVariableAccess] access to local variable w -# 265| 0: [StringLiteralUtf16] "Line three" -# 267| 1: [UsingBlockStmt] using (...) {...} -# 267| 0: [MethodCall] call to method CreateText -# 267| -1: [TypeAccess] access to type File -# 267| 0: [TypeMention] File -# 267| 0: [StringLiteralUtf16] "test.txt" -# 268| 1: [BlockStmt] {...} -# 272| 29: [Method] MainLabeled -# 272| -1: [TypeMention] Void -# 273| 4: [BlockStmt] {...} -# 274| 0: [GotoLabelStmt] goto ...; -# 275| 1: [LabelStmt] Label: -# 276| 2: [LocalVariableDeclStmt] ... ...; -# 276| 0: [LocalVariableDeclAndInitExpr] Int32 x = ... -# 276| -1: [TypeMention] int -# 276| 0: [LocalVariableAccess] access to local variable x -# 276| 1: [IntLiteral] 23 -# 277| 3: [ExprStmt] ...; -# 277| 0: [AssignExpr] ... = ... +# 265| 0: [StringLiteralUtf16] "Line two" +# 266| 2: [ExprStmt] ...; +# 266| 0: [MethodCall] call to method WriteLine +# 266| -1: [LocalVariableAccess] access to local variable w +# 266| 0: [StringLiteralUtf16] "Line three" +# 268| 1: [UsingBlockStmt] using (...) {...} +# 268| 0: [MethodCall] call to method CreateText +# 268| -1: [TypeAccess] access to type File +# 268| 0: [TypeMention] File +# 268| 0: [StringLiteralUtf16] "test.txt" +# 269| 1: [BlockStmt] {...} +# 273| 29: [Method] MainLabeled +# 273| -1: [TypeMention] Void +# 274| 4: [BlockStmt] {...} +# 275| 0: [GotoLabelStmt] goto ...; +# 276| 1: [LabelStmt] Label: +# 277| 2: [LocalVariableDeclStmt] ... ...; +# 277| 0: [LocalVariableDeclAndInitExpr] Int32 x = ... +# 277| -1: [TypeMention] int # 277| 0: [LocalVariableAccess] access to local variable x -# 277| 1: [IntLiteral] 9 +# 277| 1: [IntLiteral] 23 +# 278| 3: [ExprStmt] ...; +# 278| 0: [AssignExpr] ... = ... +# 278| 0: [LocalVariableAccess] access to local variable x +# 278| 1: [IntLiteral] 9 +# 281| 30: [Field] lockObject +# 281| -1: [TypeMention] Lock +# 281| 1: [ObjectCreation] object creation of type Lock +# 281| 0: [TypeMention] Lock +# 283| 31: [Method] LockMethod +# 283| -1: [TypeMention] Void +# 284| 4: [BlockStmt] {...} +# 285| 0: [LockStmt] lock (...) {...} +# 285| 0: [FieldAccess] access to field lockObject +# 286| 1: [BlockStmt] {...} +# 287| 0: [ExprStmt] ...; +# 287| 0: [MethodCall] call to method WriteLine +# 287| -1: [TypeAccess] access to type Console +# 287| 0: [TypeMention] Console +# 287| 0: [StringLiteralUtf16] "Locked" diff --git a/csharp/ql/test/library-tests/statements/Return1.expected b/csharp/ql/test/library-tests/statements/Return1.expected index 501e3d589f78..825866a20e39 100644 --- a/csharp/ql/test/library-tests/statements/Return1.expected +++ b/csharp/ql/test/library-tests/statements/Return1.expected @@ -1 +1 @@ -| statements.cs:177:21:177:30 | MainReturn | statements.cs:180:13:180:19 | return ...; | +| statements.cs:178:21:178:30 | MainReturn | statements.cs:181:13:181:19 | return ...; | diff --git a/csharp/ql/test/library-tests/statements/Return2.expected b/csharp/ql/test/library-tests/statements/Return2.expected index acc14246929a..4f628c18c9bf 100644 --- a/csharp/ql/test/library-tests/statements/Return2.expected +++ b/csharp/ql/test/library-tests/statements/Return2.expected @@ -1 +1 @@ -| statements.cs:173:20:173:22 | Add | statements.cs:175:13:175:25 | return ...; | statements.cs:175:20:175:24 | ... + ... | +| statements.cs:174:20:174:22 | Add | statements.cs:176:13:176:25 | return ...; | statements.cs:176:20:176:24 | ... + ... | diff --git a/csharp/ql/test/library-tests/statements/StripSingletonBlocks.expected b/csharp/ql/test/library-tests/statements/StripSingletonBlocks.expected index 96fd352116e2..3e4f80d91b2d 100644 --- a/csharp/ql/test/library-tests/statements/StripSingletonBlocks.expected +++ b/csharp/ql/test/library-tests/statements/StripSingletonBlocks.expected @@ -1,23 +1,25 @@ -| statements.cs:16:17:19:17 | {...} | statements.cs:17:21:18:21 | {...} | -| statements.cs:57:9:66:9 | {...} | statements.cs:58:13:65:13 | if (...) ... | -| statements.cs:59:13:61:13 | {...} | statements.cs:60:17:60:50 | ...; | -| statements.cs:63:13:65:13 | {...} | statements.cs:64:17:64:59 | ...; | -| statements.cs:131:9:136:9 | {...} | statements.cs:132:13:135:13 | for (...;...;...) ... | -| statements.cs:133:13:135:13 | {...} | statements.cs:134:17:134:43 | ...; | -| statements.cs:139:9:144:9 | {...} | statements.cs:140:13:143:13 | foreach (... ... in ...) ... | -| statements.cs:141:13:143:13 | {...} | statements.cs:142:17:142:37 | ...; | -| statements.cs:147:9:154:9 | {...} | statements.cs:148:13:153:13 | while (...) ... | -| statements.cs:157:9:163:9 | {...} | statements.cs:158:13:162:13 | for (...;...;...) ... | -| statements.cs:174:9:176:9 | {...} | statements.cs:175:13:175:25 | return ...; | -| statements.cs:186:13:188:13 | {...} | statements.cs:187:17:187:31 | yield return ...; | -| statements.cs:192:9:197:9 | {...} | statements.cs:193:13:196:13 | foreach (... ... in ...) ... | -| statements.cs:194:13:196:13 | {...} | statements.cs:195:17:195:37 | ...; | -| statements.cs:205:9:228:9 | {...} | statements.cs:206:13:227:13 | try {...} ... | -| statements.cs:209:17:211:17 | {...} | statements.cs:210:21:210:64 | throw ...; | -| statements.cs:217:13:219:13 | {...} | statements.cs:218:17:218:45 | ...; | -| statements.cs:221:13:223:13 | {...} | statements.cs:222:17:222:47 | ...; | -| statements.cs:225:13:227:13 | {...} | statements.cs:226:17:226:47 | ...; | -| statements.cs:234:13:236:13 | {...} | statements.cs:235:17:235:41 | ...; | -| statements.cs:238:13:240:13 | {...} | statements.cs:239:17:239:41 | ...; | -| statements.cs:247:13:256:13 | {...} | statements.cs:248:17:255:17 | lock (...) {...} | -| statements.cs:251:21:253:21 | {...} | statements.cs:252:25:252:66 | throw ...; | +| statements.cs:17:17:20:17 | {...} | statements.cs:18:21:19:21 | {...} | +| statements.cs:58:9:67:9 | {...} | statements.cs:59:13:66:13 | if (...) ... | +| statements.cs:60:13:62:13 | {...} | statements.cs:61:17:61:50 | ...; | +| statements.cs:64:13:66:13 | {...} | statements.cs:65:17:65:59 | ...; | +| statements.cs:132:9:137:9 | {...} | statements.cs:133:13:136:13 | for (...;...;...) ... | +| statements.cs:134:13:136:13 | {...} | statements.cs:135:17:135:43 | ...; | +| statements.cs:140:9:145:9 | {...} | statements.cs:141:13:144:13 | foreach (... ... in ...) ... | +| statements.cs:142:13:144:13 | {...} | statements.cs:143:17:143:37 | ...; | +| statements.cs:148:9:155:9 | {...} | statements.cs:149:13:154:13 | while (...) ... | +| statements.cs:158:9:164:9 | {...} | statements.cs:159:13:163:13 | for (...;...;...) ... | +| statements.cs:175:9:177:9 | {...} | statements.cs:176:13:176:25 | return ...; | +| statements.cs:187:13:189:13 | {...} | statements.cs:188:17:188:31 | yield return ...; | +| statements.cs:193:9:198:9 | {...} | statements.cs:194:13:197:13 | foreach (... ... in ...) ... | +| statements.cs:195:13:197:13 | {...} | statements.cs:196:17:196:37 | ...; | +| statements.cs:206:9:229:9 | {...} | statements.cs:207:13:228:13 | try {...} ... | +| statements.cs:210:17:212:17 | {...} | statements.cs:211:21:211:64 | throw ...; | +| statements.cs:218:13:220:13 | {...} | statements.cs:219:17:219:45 | ...; | +| statements.cs:222:13:224:13 | {...} | statements.cs:223:17:223:47 | ...; | +| statements.cs:226:13:228:13 | {...} | statements.cs:227:17:227:47 | ...; | +| statements.cs:235:13:237:13 | {...} | statements.cs:236:17:236:41 | ...; | +| statements.cs:239:13:241:13 | {...} | statements.cs:240:17:240:41 | ...; | +| statements.cs:248:13:257:13 | {...} | statements.cs:249:17:256:17 | lock (...) {...} | +| statements.cs:252:21:254:21 | {...} | statements.cs:253:25:253:66 | throw ...; | +| statements.cs:284:9:289:9 | {...} | statements.cs:285:13:288:13 | lock (...) {...} | +| statements.cs:286:13:288:13 | {...} | statements.cs:287:17:287:44 | ...; | diff --git a/csharp/ql/test/library-tests/statements/Switch1.expected b/csharp/ql/test/library-tests/statements/Switch1.expected index 972dbb55ae00..13da21fd1604 100644 --- a/csharp/ql/test/library-tests/statements/Switch1.expected +++ b/csharp/ql/test/library-tests/statements/Switch1.expected @@ -1,2 +1,2 @@ -| statements.cs:71:13:82:13 | switch (...) {...} | statements.cs:71:21:71:21 | access to local variable n | 2 | 1 | 9 | -| statements.cs:87:13:106:13 | switch (...) {...} | statements.cs:87:21:87:23 | access to parameter foo | 9 | 0 | 17 | +| statements.cs:72:13:83:13 | switch (...) {...} | statements.cs:72:21:72:21 | access to local variable n | 2 | 1 | 9 | +| statements.cs:88:13:107:13 | switch (...) {...} | statements.cs:88:21:88:23 | access to parameter foo | 9 | 0 | 17 | diff --git a/csharp/ql/test/library-tests/statements/Switch2.expected b/csharp/ql/test/library-tests/statements/Switch2.expected index e25573b78e89..0144318bc657 100644 --- a/csharp/ql/test/library-tests/statements/Switch2.expected +++ b/csharp/ql/test/library-tests/statements/Switch2.expected @@ -1,11 +1,11 @@ -| statements.cs:68:21:68:30 | MainSwitch | statements.cs:73:17:73:23 | case ...: | 73 | -| statements.cs:68:21:68:30 | MainSwitch | statements.cs:76:17:76:23 | case ...: | 76 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:89:17:89:29 | case ...: | 89 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:91:17:91:27 | case ...: | 91 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:93:17:93:29 | case ...: | 93 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:95:17:95:30 | case ...: | 95 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:97:17:97:28 | case ...: | 97 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:99:17:99:31 | case ...: | 99 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:101:17:101:28 | case ...: | 101 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:103:17:103:28 | case ...: | 103 | -| statements.cs:85:20:85:31 | StringSwitch | statements.cs:104:17:104:29 | case ...: | 104 | +| statements.cs:69:21:69:30 | MainSwitch | statements.cs:74:17:74:23 | case ...: | 74 | +| statements.cs:69:21:69:30 | MainSwitch | statements.cs:77:17:77:23 | case ...: | 77 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:90:17:90:29 | case ...: | 90 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:92:17:92:27 | case ...: | 92 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:94:17:94:29 | case ...: | 94 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:96:17:96:30 | case ...: | 96 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:98:17:98:28 | case ...: | 98 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:100:17:100:31 | case ...: | 100 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:102:17:102:28 | case ...: | 102 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:104:17:104:28 | case ...: | 104 | +| statements.cs:86:20:86:31 | StringSwitch | statements.cs:105:17:105:29 | case ...: | 105 | diff --git a/csharp/ql/test/library-tests/statements/Switch3.expected b/csharp/ql/test/library-tests/statements/Switch3.expected index 639669973335..69307de1ba78 100644 --- a/csharp/ql/test/library-tests/statements/Switch3.expected +++ b/csharp/ql/test/library-tests/statements/Switch3.expected @@ -1 +1 @@ -| statements.cs:68:21:68:30 | MainSwitch | statements.cs:79:17:79:24 | default: | 79 | +| statements.cs:69:21:69:30 | MainSwitch | statements.cs:80:17:80:24 | default: | 80 | diff --git a/csharp/ql/test/library-tests/statements/Switch4.expected b/csharp/ql/test/library-tests/statements/Switch4.expected index 6ae12fe550fb..bec962e22b54 100644 --- a/csharp/ql/test/library-tests/statements/Switch4.expected +++ b/csharp/ql/test/library-tests/statements/Switch4.expected @@ -1 +1,2 @@ -| statements.cs:245:21:245:27 | balance | +| statements.cs:246:21:246:27 | balance | +| statements.cs:281:31:281:40 | lockObject | diff --git a/csharp/ql/test/library-tests/statements/Throw1.expected b/csharp/ql/test/library-tests/statements/Throw1.expected index 45041571af08..2267b61f3f5b 100644 --- a/csharp/ql/test/library-tests/statements/Throw1.expected +++ b/csharp/ql/test/library-tests/statements/Throw1.expected @@ -1 +1 @@ -| 1 | statements.cs:201:31:201:57 | object creation of type DivideByZeroException | +| 1 | statements.cs:202:31:202:57 | object creation of type DivideByZeroException | diff --git a/csharp/ql/test/library-tests/statements/TryCatch2.expected b/csharp/ql/test/library-tests/statements/TryCatch2.expected index 1fd0f369cece..589951929619 100644 --- a/csharp/ql/test/library-tests/statements/TryCatch2.expected +++ b/csharp/ql/test/library-tests/statements/TryCatch2.expected @@ -1,2 +1,2 @@ -| statements.cs:206:13:227:13 | try {...} ... | statements.cs:216:13:219:13 | catch (...) {...} | -| statements.cs:206:13:227:13 | try {...} ... | statements.cs:220:13:223:13 | catch {...} | +| statements.cs:207:13:228:13 | try {...} ... | statements.cs:217:13:220:13 | catch (...) {...} | +| statements.cs:207:13:228:13 | try {...} ... | statements.cs:221:13:224:13 | catch {...} | diff --git a/csharp/ql/test/library-tests/statements/TryCatch3.expected b/csharp/ql/test/library-tests/statements/TryCatch3.expected index 1fd0f369cece..589951929619 100644 --- a/csharp/ql/test/library-tests/statements/TryCatch3.expected +++ b/csharp/ql/test/library-tests/statements/TryCatch3.expected @@ -1,2 +1,2 @@ -| statements.cs:206:13:227:13 | try {...} ... | statements.cs:216:13:219:13 | catch (...) {...} | -| statements.cs:206:13:227:13 | try {...} ... | statements.cs:220:13:223:13 | catch {...} | +| statements.cs:207:13:228:13 | try {...} ... | statements.cs:217:13:220:13 | catch (...) {...} | +| statements.cs:207:13:228:13 | try {...} ... | statements.cs:221:13:224:13 | catch {...} | diff --git a/csharp/ql/test/library-tests/statements/TryCatch4.expected b/csharp/ql/test/library-tests/statements/TryCatch4.expected index 02f3e431cfe3..87c85194f8ae 100644 --- a/csharp/ql/test/library-tests/statements/TryCatch4.expected +++ b/csharp/ql/test/library-tests/statements/TryCatch4.expected @@ -1 +1 @@ -| statements.cs:216:13:219:13 | catch (...) {...} | Exception | +| statements.cs:217:13:220:13 | catch (...) {...} | Exception | diff --git a/csharp/ql/test/library-tests/statements/TryCatch5.expected b/csharp/ql/test/library-tests/statements/TryCatch5.expected index 02f3e431cfe3..87c85194f8ae 100644 --- a/csharp/ql/test/library-tests/statements/TryCatch5.expected +++ b/csharp/ql/test/library-tests/statements/TryCatch5.expected @@ -1 +1 @@ -| statements.cs:216:13:219:13 | catch (...) {...} | Exception | +| statements.cs:217:13:220:13 | catch (...) {...} | Exception | diff --git a/csharp/ql/test/library-tests/statements/TryCatch6.expected b/csharp/ql/test/library-tests/statements/TryCatch6.expected index c6a91eb5c53a..c121829d40af 100644 --- a/csharp/ql/test/library-tests/statements/TryCatch6.expected +++ b/csharp/ql/test/library-tests/statements/TryCatch6.expected @@ -1 +1 @@ -| statements.cs:216:30:216:30 | e | statements.cs:218:35:218:35 | access to local variable e | +| statements.cs:217:30:217:30 | e | statements.cs:219:35:219:35 | access to local variable e | diff --git a/csharp/ql/test/library-tests/statements/TryCatch7.expected b/csharp/ql/test/library-tests/statements/TryCatch7.expected index a72070c2bf5f..1fe201f13342 100644 --- a/csharp/ql/test/library-tests/statements/TryCatch7.expected +++ b/csharp/ql/test/library-tests/statements/TryCatch7.expected @@ -1 +1 @@ -| statements.cs:204:21:204:32 | MainTryThrow | +| statements.cs:205:21:205:32 | MainTryThrow | diff --git a/csharp/ql/test/library-tests/statements/TryCatch8.expected b/csharp/ql/test/library-tests/statements/TryCatch8.expected index a4dca206c4bb..44f2b1120045 100644 --- a/csharp/ql/test/library-tests/statements/TryCatch8.expected +++ b/csharp/ql/test/library-tests/statements/TryCatch8.expected @@ -1 +1 @@ -| statements.cs:220:13:223:13 | catch {...} | Exception | +| statements.cs:221:13:224:13 | catch {...} | Exception | diff --git a/csharp/ql/test/library-tests/statements/TryFinally1.expected b/csharp/ql/test/library-tests/statements/TryFinally1.expected index c963b55ba8c0..c66126a74d74 100644 --- a/csharp/ql/test/library-tests/statements/TryFinally1.expected +++ b/csharp/ql/test/library-tests/statements/TryFinally1.expected @@ -1 +1 @@ -| statements.cs:225:13:227:13 | {...} | +| statements.cs:226:13:228:13 | {...} | diff --git a/csharp/ql/test/library-tests/statements/Unchecked1.expected b/csharp/ql/test/library-tests/statements/Unchecked1.expected index e13f137ced18..a966b32032aa 100644 --- a/csharp/ql/test/library-tests/statements/Unchecked1.expected +++ b/csharp/ql/test/library-tests/statements/Unchecked1.expected @@ -1 +1 @@ -| statements.cs:237:13:240:13 | unchecked {...} | statements.cs:238:13:240:13 | {...} | +| statements.cs:238:13:241:13 | unchecked {...} | statements.cs:239:13:241:13 | {...} | diff --git a/csharp/ql/test/library-tests/statements/Using2.expected b/csharp/ql/test/library-tests/statements/Using2.expected index 9ea16fc51647..00ae3b0dffcf 100644 --- a/csharp/ql/test/library-tests/statements/Using2.expected +++ b/csharp/ql/test/library-tests/statements/Using2.expected @@ -1 +1 @@ -| statements.cs:259:21:259:29 | MainUsing | +| statements.cs:260:21:260:29 | MainUsing | diff --git a/csharp/ql/test/library-tests/statements/Using3.expected b/csharp/ql/test/library-tests/statements/Using3.expected index 611d892729ae..9ffab1eed420 100644 --- a/csharp/ql/test/library-tests/statements/Using3.expected +++ b/csharp/ql/test/library-tests/statements/Using3.expected @@ -1 +1 @@ -| statements.cs:259:21:259:29 | MainUsing | statements.cs:261:31:261:31 | w | +| statements.cs:260:21:260:29 | MainUsing | statements.cs:262:31:262:31 | w | diff --git a/csharp/ql/test/library-tests/statements/While2.expected b/csharp/ql/test/library-tests/statements/While2.expected index 91806d99f808..9d4000ea8a6a 100644 --- a/csharp/ql/test/library-tests/statements/While2.expected +++ b/csharp/ql/test/library-tests/statements/While2.expected @@ -1 +1 @@ -| statements.cs:110:21:110:29 | MainWhile | statements.cs:113:13:117:13 | while (...) ... | +| statements.cs:111:21:111:29 | MainWhile | statements.cs:114:13:118:13 | while (...) ... | From 1aa7c3fdcc75fefee62fc8bf89ecff352951ea78 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 20 Dec 2024 15:02:36 +0100 Subject: [PATCH 3/3] C#: Add test for the new lock type. --- csharp/ql/test/library-tests/statements/Lock3.expected | 1 + csharp/ql/test/library-tests/statements/Lock3.ql | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 csharp/ql/test/library-tests/statements/Lock3.expected create mode 100644 csharp/ql/test/library-tests/statements/Lock3.ql diff --git a/csharp/ql/test/library-tests/statements/Lock3.expected b/csharp/ql/test/library-tests/statements/Lock3.expected new file mode 100644 index 000000000000..a9eded769792 --- /dev/null +++ b/csharp/ql/test/library-tests/statements/Lock3.expected @@ -0,0 +1 @@ +| statements.cs:285:13:288:13 | lock (...) {...} | statements.cs:285:19:285:28 | access to field lockObject | Lock | statements.cs:286:13:288:13 | {...} | diff --git a/csharp/ql/test/library-tests/statements/Lock3.ql b/csharp/ql/test/library-tests/statements/Lock3.ql new file mode 100644 index 000000000000..e7ff8d201728 --- /dev/null +++ b/csharp/ql/test/library-tests/statements/Lock3.ql @@ -0,0 +1,8 @@ +import csharp + +from Method m, LockStmt ls, Expr lockExpr +where + ls.getEnclosingCallable() = m and + m.getName() = "LockMethod" and + lockExpr = ls.getExpr() +select ls, lockExpr, lockExpr.getType().toString(), ls.getBlock()