Files
2026-01-20 16:03:43 +00:00

21 lines
502 B
Plaintext

# Test that the various wrappers that the Python binding instantiates
# (contexts, units, nodes) are re-used whenever we want to wrap unique C
# values.
from lexer_example import foo_lexer
@with_lexer(foo_lexer)
grammar foo_grammar {
@main_rule main_rule <- example_list
example_list <- list+(example)
example <- Example("example" ?pick("(" example_list ")"))
}
@abstract
class FooNode implements Node[FooNode] {
}
class Example: FooNode {
@parse_field examples: ASTList[Example]
}