mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
19 lines
332 B
Python
19 lines
332 B
Python
|
|
import sys
|
||
|
|
|
||
|
|
import libfoolang
|
||
|
|
|
||
|
|
|
||
|
|
print("main.py: Running...")
|
||
|
|
|
||
|
|
ctx = libfoolang.AnalysisContext()
|
||
|
|
u = ctx.get_from_buffer("foo.txt", b"foobar")
|
||
|
|
if u.diagnostics:
|
||
|
|
for d in u.diagnostics:
|
||
|
|
print(d)
|
||
|
|
sys.exit(1)
|
||
|
|
|
||
|
|
sloc = u.root.sloc_range.end
|
||
|
|
print(f"p_id_sloc({sloc}) = {u.root.p_id_sloc(sloc)}")
|
||
|
|
|
||
|
|
print("main.py: Done.")
|