2023-08-03 11:15:23 +00:00
|
|
|
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");
|
|
|
|
|
|
2024-03-28 11:12:48 +01:00
|
|
|
FooNode[] nodes;
|
2023-08-03 11:15:23 +00:00
|
|
|
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.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|