chore: add test cases for choice statement parsing

This commit is contained in:
Brett Broadhurst 2026-03-26 08:48:27 -06:00
parent 7afc6719d9
commit 6f54e6fbcd
Failed to generate hash of commit
5 changed files with 85 additions and 64 deletions

View file

@ -1,11 +0,0 @@
// RUN: %ink-compiler --stdin --compile-only --dump-ast < %s | FileCheck %s
// CHECK: File "<STDIN>"
// CHECK-NEXT: `--BlockStmt <line:11, line:11>
// CHECK-NEXT: `--ChoiceStmt <line:11, line:11>
// CHECK-NEXT: `--ChoiceStarStmt <line:11, col:1:7>
// CHECK-NEXT: `--ChoiceContentExpr <col:3, col:7>
// CHECK-NEXT: |--ChoiceStartContentExpr `A` <col:3, col:4>
// CHECK-NEXT: `--ChoiceInnerContentExpr `B` <col:6, col:7>
* A[]B

View file

@ -1,26 +0,0 @@
// RUN: %ink-compiler --stdin --compile-only --dump-ast < %s | FileCheck %s
// CHECK: File "<STDIN>"
// CHECK-NEXT: `--BlockStmt <line:22, line:26>
// CHECK-NEXT: `--ChoiceStmt <line:22, line:26>
// CHECK-NEXT: |--ChoiceStarStmt <line:22, col:1:8>
// CHECK-NEXT: | `--ChoiceContentExpr <col:7, col:8>
// CHECK-NEXT: | `--ChoiceStartContentExpr `A` <col:7, col:8>
// CHECK-NEXT: |--ChoiceStarStmt <line:23, col:1:7>
// CHECK-NEXT: | `--ChoiceContentExpr <col:6, col:7>
// CHECK-NEXT: | `--ChoiceStartContentExpr `B` <col:6, col:7>
// CHECK-NEXT: |--ChoiceStarStmt <line:24, col:1:6>
// CHECK-NEXT: | `--ChoiceContentExpr <col:5, col:6>
// CHECK-NEXT: | `--ChoiceStartContentExpr `C` <col:5, col:6>
// CHECK-NEXT: |--ChoiceStarStmt <line:25, col:1:5>
// CHECK-NEXT: | `--ChoiceContentExpr <col:4, col:5>
// CHECK-NEXT: | `--ChoiceStartContentExpr `D` <col:4, col:5>
// CHECK-NEXT: `--ChoiceStarStmt <line:26, col:1:4>
// CHECK-NEXT: `--ChoiceContentExpr <col:3, col:4>
// CHECK-NEXT: `--ChoiceStartContentExpr `E` <col:3, col:4>
***** A
**** B
*** C
** D
* E

View file

@ -1,9 +0,0 @@
// RUN: %ink-compiler --stdin --compile-only --dump-ast < %s | FileCheck %s
// CHECK: File "<STDIN>"
// CHECK-NEXT: `--BlockStmt <line:9, line:9>
// CHECK-NEXT: `--ChoiceStmt <line:9, line:9>
// CHECK-NEXT: `--ChoiceStarStmt <line:9, col:1:2>
// CHECK-NEXT: `--ChoiceContentExpr <col:2, col:2>
*

View file

@ -1,18 +0,0 @@
// RUN: %ink-compiler --stdin --compile-only --dump-ast < %s | FileCheck %s
// CHECK: File "<STDIN>"
// CHECK-NEXT: `--BlockStmt <line:16, line:18>
// CHECK-NEXT: `--ChoiceStmt <line:16, line:18>
// CHECK-NEXT: |--ChoiceStarStmt <line:16, col:1:4>
// CHECK-NEXT: | `--ChoiceContentExpr <col:3, col:4>
// CHECK-NEXT: | `--ChoiceStartContentExpr `A` <col:3, col:4>
// CHECK-NEXT: |--ChoiceStarStmt <line:17, col:1:4>
// CHECK-NEXT: | `--ChoiceContentExpr <col:3, col:4>
// CHECK-NEXT: | `--ChoiceStartContentExpr `B` <col:3, col:4>
// CHECK-NEXT: `--ChoiceStarStmt <line:18, col:1:4>
// CHECK-NEXT: `--ChoiceContentExpr <col:3, col:4>
// CHECK-NEXT: `--ChoiceStartContentExpr `C` <col:3, col:4>
* A
* B
* C