tree-sitter-d2/test/corpus/shape.txt
2022-12-09 18:21:55 +03:00

182 lines
4.4 KiB
Text

================================================================================
Handle end of file (issue #1)
================================================================================
foo
--------------------------------------------------------------------------------
(source_file
(shape (shape_key))
)
================================================================================
Simple shape key
================================================================================
foo
bar
--------------------------------------------------------------------------------
(source_file
(shape (shape_key))
(shape (shape_key))
)
================================================================================
Complex shape key
================================================================================
Foo bar
-Biz-baz-
imAShape
im_a_shape
im a shape
i'm a shape
a-shape
--------------------------------------------------------------------------------
(source_file
(shape (shape_key))
(shape (shape_key))
(shape (shape_key))
(shape (shape_key))
(shape (shape_key))
(shape (shape_key))
(shape (shape_key))
)
================================================================================
Use quoted string as a shape key
================================================================================
'foo'
--------------------------------------------------------------------------------
(source_file
(shape (shape_key (string)))
)
================================================================================
Define multiple shapes using semicolons
================================================================================
a;b;c
--------------------------------------------------------------------------------
(source_file
(shape (shape_key))
(shape (shape_key))
(shape (shape_key))
)
================================================================================
Labeled shapes
================================================================================
a: Foo Bar
a: Foo Bar; b: Biz Baz
--------------------------------------------------------------------------------
(source_file
(shape (shape_key) (label))
(shape (shape_key) (label))
(shape (shape_key) (label))
)
================================================================================
It should skip white spaces
================================================================================
foo
bar : Foo Bar; baz
--------------------------------------------------------------------------------
(source_file
(shape (shape_key))
(shape (shape_key) (label))
(shape (shape_key))
)
================================================================================
Use quoted string as shape key and label
================================================================================
'foo': "Label"
--------------------------------------------------------------------------------
(source_file
(shape (shape_key (string)) (label (string)))
)
================================================================================
Basic text block
================================================================================
foo: |
- hello
|
--------------------------------------------------------------------------------
(source_file
(shape
(shape_key)
(text_block
(raw_text)
)
)
)
================================================================================
Text block with specific language
================================================================================
foo: |go
awsSession := From(c.Request.Context())
client := s3.New(awsSession)
ctx, cancelFn := context.WithTimeout(c.Request.Context(), AWS_TIMEOUT)
defer cancelFn()
|
--------------------------------------------------------------------------------
(source_file
(shape
(shape_key)
(text_block
(language)
(raw_text)
)
)
)
================================================================================
Text block with quotes (d2-vim style)
================================================================================
foo: |`go
awsSession := From(c.Request.Context())
client := s3.New(awsSession)
ctx, cancelFn := context.WithTimeout(c.Request.Context(), AWS_TIMEOUT)
defer cancelFn()
`|
--------------------------------------------------------------------------------
(source_file
(shape
(shape_key)
(text_block
(language)
(raw_text)
)
)
)