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

97 lines
2.1 KiB
Text

================================================================================
Declare a shape inside a container
================================================================================
foo.baz
--------------------------------------------------------------------------------
(source_file
(container_key) (dot) (shape_key)
)
================================================================================
Use quoted string as a shape key
================================================================================
'foo'.'baz'
--------------------------------------------------------------------------------
(source_file
(container_key (string)) (dot) (shape_key (string))
)
================================================================================
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)
)
)
)
)
================================================================================
Declare many shapes inside a container
================================================================================
foo: {
bar
biz
baz
}
--------------------------------------------------------------------------------
(source_file
(shape_key)
(block
(shape_key)
(shape_key)
(shape_key)
)
)