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
19 lines
390 B
Python
19 lines
390 B
Python
import libadalang
|
|
|
|
|
|
src_buffer = b"""
|
|
limited with Ada.Text_IO;
|
|
|
|
procedure Foo is
|
|
function \"+\" (S : String) return String is (S);
|
|
begin
|
|
Ada.Text_IO.Put_Line (+\"Hello, world!\");
|
|
end Foo;
|
|
"""
|
|
|
|
ctx = libadalang.AnalysisContext('iso-8859-1')
|
|
unit = ctx.get_from_buffer('foo.adb', src_buffer)
|
|
assert unit, 'Could not create the analysis unit for foo.adb from a buffer'
|
|
|
|
print('Done.')
|