2021-03-26 09:14:52 -04:00
|
|
|
import libfoolang
|
|
|
|
|
|
|
|
|
|
|
2025-03-20 12:57:48 +00:00
|
|
|
print("main.py: Running...")
|
2021-03-26 09:14:52 -04:00
|
|
|
|
|
|
|
|
ctx = libfoolang.AnalysisContext()
|
2025-03-20 12:57:48 +00:00
|
|
|
u = ctx.get_from_buffer("foo.txt", b"{example example")
|
2021-03-26 09:14:52 -04:00
|
|
|
|
|
|
|
|
print("Diagnostics:")
|
|
|
|
|
for d in u.diagnostics:
|
|
|
|
|
print(d)
|
|
|
|
|
print("")
|
|
|
|
|
|
|
|
|
|
print("Token range:")
|
|
|
|
|
text_range = libfoolang.Token.text_range(u.first_token, u.last_token)
|
2021-09-23 11:29:59 +00:00
|
|
|
print(repr(text_range))
|
2021-03-26 09:14:52 -04:00
|
|
|
print("")
|
|
|
|
|
|
2025-03-20 12:57:48 +00:00
|
|
|
print("main.py: Done.")
|