mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
21 lines
502 B
Plaintext
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]
|
|
}
|