Files
langkit/testsuite/tests/python_api/array-struct-array/test.py
Pierre-Marie de Rodat 2b9b33d6a0 Remove __future__ imports and adjust stylechecks
TN: T511-017
2020-05-26 12:33:48 +02:00

23 lines
547 B
Python

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')