tree-sitter-d2/test/corpus/container.txt

77 lines
1.7 KiB
Text
Raw Normal View History

2022-12-07 23:22:40 +03:00
================================================================================
Declare a shape inside a container
================================================================================
foo.baz
--------------------------------------------------------------------------------
(source_file
2022-12-08 01:15:09 +03:00
(container_key) (dot) (shape_key)
2022-12-07 23:22:40 +03:00
)
================================================================================
Use quoted string as a shape key
================================================================================
'foo'.'baz'
--------------------------------------------------------------------------------
(source_file
2022-12-08 01:15:09 +03:00
(container_key (string)) (dot) (shape_key (string))
2022-12-07 23:22:40 +03:00
)
================================================================================
Declare container inside a container using block
================================================================================
foo: {
bar: {
baz: {
biz
}
}
}
--------------------------------------------------------------------------------
(source_file
(shape_key)
(block
(shape_key)
(block
(shape_key)
(block
(shape_key)
)
)
)
)
================================================================================
Declare labaled container inside a labeled container using block
================================================================================
foo: Foo {
bar: Bar {
baz: Baz {
biz: Biz
}
}
}
--------------------------------------------------------------------------------
(source_file
(shape_key) (label)
(block
(shape_key) (label)
(block
(shape_key) (label)
(block
(shape_key) (label)
)
)
)
)