Logo
Explore Help
Sign In
ada/langkit
0
0
Fork 0
You've already forked langkit
mirror of https://github.com/AdaCore/langkit.git synced 2026-02-12 12:28:12 -08:00
Code Issues Packages Projects Releases Wiki Activity
Files
22.2
langkit/testsuite/tests/python_api/asserts/main.py

20 lines
363 B
Python
Raw Permalink Normal View History

Python API: fix bindings when assertions are disabled Python's -O command-line option disableds the execution of "assert" statements. In order for the generated Python bindings to work in such a mode, we need to keep assertion logic only in "assert" statements. This commit fixes statements that currently don't respect this principle. Fixes GitHub issue #485 TN: U326-020
2021-03-26 09:14:52 -04:00
import libfoolang
print('main.py: Running...')
ctx = libfoolang.AnalysisContext()
u = ctx.get_from_buffer('foo.txt', b'{example example')
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)
Python API: remove support for Python2 TN: U720-016
2021-09-23 11:29:59 +00:00
print(repr(text_range))
Python API: fix bindings when assertions are disabled Python's -O command-line option disableds the execution of "assert" statements. In order for the generated Python bindings to work in such a mode, we need to keep assertion logic only in "assert" statements. This commit fixes statements that currently don't respect this principle. Fixes GitHub issue #485 TN: U326-020
2021-03-26 09:14:52 -04:00
print("")
print('main.py: Done.')
Reference in New Issue Copy Permalink
Powered by Gitea Page: 257ms Template: 21ms
English
English
Licenses API