Files
langkit/testsuite/tests/python-api/ghost_nodes/main.py
Pierre-Marie de Rodat d11c8a5d4a Remove all unicode_literals imports from __future__
TN: Q223-029
2017-04-25 14:24:30 +02:00

16 lines
367 B
Python

from __future__ import absolute_import, division, print_function
import libfoolang
ctx = libfoolang.AnalysisContext()
unit = ctx.get_from_file('foo.txt')
for node in unit.root.findall(lambda _: True):
print('{} node: {}'.format(
'Ghost' if node.is_ghost else 'Regular',
node
))
assert not node.text or not node.is_ghost
print('Done.')