Files
2025-03-26 14:04:20 +00:00

11 lines
279 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.")