Test reentering parser for nested inner parses

This commit is contained in:
josh committed 2026-07-14 11:41:52 -04:00
1 parent 0aaa44faf4
commit 7ce1f8fc7f
9 files changed
+427

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
<<
import test_parse_inner_nested;
>>
ptype int;
lex_fn mylexfn;
drop /\s+/;
token lparen /\(/;
token rparen /\)/;
token plus /\+/;
token num /\d+/ << int n = 0; foreach (ch; match) { n *= 10; n += (ch - '0'); } $$ = n; >>
Start -> Expr << $$ = $1; >>
Expr -> num << $$ = $1; >>
Expr -> Expr plus num << $$ = $1 + $3; >>