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

133 lines
3.1 KiB
Plaintext

================================================================================
Simple shape
================================================================================
foo
bar
--------------------------------------------------------------------------------
(source_file
(shape (identifier))
(shape (identifier))
)
================================================================================
Complex identifier
================================================================================
Foo bar
-Biz-baz-
--------------------------------------------------------------------------------
(source_file
(shape (identifier))
(shape (identifier))
)
================================================================================
Inline shapes
================================================================================
foo.baz
--------------------------------------------------------------------------------
(source_file
(shape
(identifier)
(dot)
(identifier)
)
)
================================================================================
Many shapes inline
================================================================================
a;b;c
--------------------------------------------------------------------------------
(source_file
(shape (identifier))
(shape (identifier))
(shape (identifier))
)
================================================================================
Aliased shapes
================================================================================
a: Foo Bar
a: Foo Bar; b: Biz Baz
--------------------------------------------------------------------------------
(source_file
(shape (identifier) (label))
(shape (identifier) (label))
(shape (identifier) (label))
)
================================================================================
It should skip white spaces
================================================================================
foo
bar : Foo Bar; baz
--------------------------------------------------------------------------------
(source_file
(shape (identifier))
(shape (identifier) (label))
(shape (identifier))
)
================================================================================
Shape block
================================================================================
foo: {
bar: {
baz: {
biz
}
}
}
--------------------------------------------------------------------------------
(source_file
(shape (identifier) (block
(shape (identifier) (block
(shape (identifier) (block
(shape (identifier))
))
))
))
)
================================================================================
Aliased shape block
================================================================================
foo: Foo {
bar: Bar {
baz: Baz {
biz: Biz
}
}
}
--------------------------------------------------------------------------------
(source_file
(shape (identifier) (label) (block
(shape (identifier) (label) (block
(shape (identifier) (label) (block
(shape (identifier) (label))
))
))
))
)