You've already forked libadalang
mirror of
https://github.com/AdaCore/libadalang.git
synced 2026-02-12 12:28:54 -08:00
Move most of "ada/*" to the root directory (this makes sense, as this repository has been dedicated to Libadalang for years), and rename "ada/language" to "ada". TN: T914-010
17 lines
331 B
Python
17 lines
331 B
Python
"""
|
|
Test that AdaNode.lookup works properly.
|
|
"""
|
|
|
|
import libadalang as lal
|
|
|
|
|
|
ctx = lal.AnalysisContext()
|
|
unit = ctx.get_from_file('foo.adb')
|
|
|
|
for line, column in [(0, 0), (1, 1), (5, 80), (6, 16), (8, 12)]:
|
|
sloc = lal.Sloc(line, column)
|
|
n = unit.root.lookup(sloc)
|
|
print('Lookup {}: {}'.format(sloc, n))
|
|
|
|
print('Done.')
|