mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
27 lines
561 B
Plaintext
27 lines
561 B
Plaintext
# Check that the Python bindings to wrap/unwrap arrays of structs of arrays work
|
|
# as expected.
|
|
|
|
from lexer_example import foo_lexer
|
|
|
|
@with_lexer(foo_lexer)
|
|
grammar foo_grammar {
|
|
@main_rule main_rule <- Example("example")
|
|
}
|
|
|
|
@abstract
|
|
class FooNode implements Node[FooNode] {
|
|
}
|
|
|
|
class Example: FooNode {
|
|
@exported
|
|
fun example_holders(): Array[ExampleHolder] =
|
|
[ExampleHolder(examples=[self])]
|
|
|
|
@exported
|
|
fun identity(a: Array[ExampleHolder]): Array[ExampleHolder] = a
|
|
}
|
|
|
|
struct ExampleHolder {
|
|
examples: Array[Entity[Example]]
|
|
}
|