Files
langkit/testsuite/tests/python-api/unit_filename/test.py
Pierre-Marie de Rodat abb941feec Parsers: keep parsed tokens by default
Also simplify token parsers throughout all the testsuite.

TN: R125-040
2018-01-29 12:09:07 +01:00

27 lines
450 B
Python

"""
Test getting the filename corresponding to an analysis unit.
"""
from __future__ import absolute_import, division, print_function
from langkit.dsl import ASTNode
from langkit.parsers import Grammar
from utils import build_and_run
class FooNode(ASTNode):
pass
class Example(FooNode):
pass
foo_grammar = Grammar('main_rule')
foo_grammar.add_rules(main_rule=Example('example'))
build_and_run(foo_grammar, 'main.py')
print('Done')