mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
27 lines
740 B
Java
27 lines
740 B
Java
import com.adacore.libfoolang.Libfoolang.*;
|
|
|
|
/**
|
|
* Check that exception handling for a property that returns an array works as
|
|
* expected. It used to trigger a sefault.
|
|
*/
|
|
public final class Main {
|
|
|
|
public static void main(String[] args) {
|
|
AnalysisContext ctx = AnalysisContext.create();
|
|
AnalysisUnit u = ctx.getUnitFromBuffer("example", "main.txt");
|
|
|
|
FooNode[] nodes;
|
|
System.out.println("About to call pProp...");
|
|
try {
|
|
nodes = u.getRoot().pProp();
|
|
} catch (LangkitException exc) {
|
|
System.out.println(
|
|
"Got an exception (" + exc.kind + "): " + exc.getMessage()
|
|
);
|
|
}
|
|
|
|
System.out.println("Main.java: done.");
|
|
}
|
|
|
|
}
|