diff options
| author | Mel <mel@rnrd.eu> | 2025-07-05 22:48:09 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-07-05 22:48:09 +0200 |
| commit | 620d82a5e314a82784e02b4af387a67d53242149 (patch) | |
| tree | e91774653130cb34d19901aeaa7cdd6be97f3e93 /boot/tests/parse | |
| parent | b71f85a7c3ee9e36b6eab9f113436fa990f6e561 (diff) | |
| download | catskill-620d82a5e314a82784e02b4af387a67d53242149.tar.zst catskill-620d82a5e314a82784e02b4af387a67d53242149.zip | |
Correctly recurse over self-containing non-homogenous postfix-type expressions
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/tests/parse')
| -rw-r--r-- | boot/tests/parse/postfix_chaining.cskt | 13 | ||||
| -rw-r--r-- | boot/tests/parse/try_must.cskt | 12 |
2 files changed, 25 insertions, 0 deletions
diff --git a/boot/tests/parse/postfix_chaining.cskt b/boot/tests/parse/postfix_chaining.cskt new file mode 100644 index 0000000..c2267b4 --- /dev/null +++ b/boot/tests/parse/postfix_chaining.cskt @@ -0,0 +1,13 @@ +correct handling of different recursive postfix expressions, +to prevent previous regression of only allowing homogeneous +postfix recursion. + +<<< + +a[1][2][3] +a.b("hi")!?++-- + +>>> + +(expr (subscript (expr (subscript (expr (subscript (expr (name a)) (expr 1))) (expr 2))) (expr 3))) +(expr (increment/decrement -- postfix (expr (increment/decrement ++ postfix (expr (try (expr (must (expr (call/construct (expr (member of (expr (name a)) named b)) (arg (expr "hi")))))))))))) \ No newline at end of file diff --git a/boot/tests/parse/try_must.cskt b/boot/tests/parse/try_must.cskt index e69de29..b111ed5 100644 --- a/boot/tests/parse/try_must.cskt +++ b/boot/tests/parse/try_must.cskt @@ -0,0 +1,12 @@ +chaining of try and must expressions, with themselves +and across multiple members + +<<< + +a!.b?.c? +c!!! + +>>> + +(expr (try (expr (member of (expr (try (expr (member of (expr (must (expr (name a)))) named b)))) named c)))) +(expr (must (expr (must (expr (must (expr (name c)))))))) \ No newline at end of file |
