2024-10-14 09:47:37 +00:00
|
|
|
# Test that Symbol bindings in the Python API are properly working
|
|
|
|
|
|
2026-01-13 14:49:31 +00:00
|
|
|
from lexer_example import foo_lexer
|
2024-01-11 15:16:41 +00:00
|
|
|
|
|
|
|
|
@with_lexer(foo_lexer)
|
|
|
|
|
grammar foo_grammar {
|
2024-06-20 11:22:42 +00:00
|
|
|
@main_rule main_rule <- Example(@Identifier)
|
2024-01-11 15:16:41 +00:00
|
|
|
}
|
|
|
|
|
|
2024-06-27 17:49:11 +02:00
|
|
|
@abstract
|
|
|
|
|
class FooNode implements Node[FooNode] {
|
2024-01-11 15:16:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Example: FooNode implements TokenNode {
|
2024-06-27 17:49:11 +02:00
|
|
|
@exported
|
|
|
|
|
fun id_sloc(l: SourceLocation): SourceLocation = l
|
2024-01-11 15:16:41 +00:00
|
|
|
}
|