mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
14 lines
301 B
Python
14 lines
301 B
Python
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.')
|