mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
25 lines
613 B
Python
25 lines
613 B
Python
from __future__ import absolute_import, division, print_function
|
|
|
|
from langkit.dsl import ASTNode, Struct, T, UserField
|
|
from langkit.expressions import Entity, langkit_property
|
|
|
|
from utils import build_and_run
|
|
|
|
|
|
class FooNode(ASTNode):
|
|
pass
|
|
|
|
|
|
class ExampleHolder(Struct):
|
|
examples = UserField(type=T.Example.entity.array)
|
|
|
|
|
|
class Example(FooNode):
|
|
@langkit_property(return_type=ExampleHolder.array, public=True)
|
|
def example_holders():
|
|
return ExampleHolder.new(examples=Entity.singleton).singleton
|
|
|
|
|
|
build_and_run(lkt_file='expected_concrete_syntax.lkt', py_script='main.py')
|
|
print('Done')
|