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

92 lines
2.5 KiB
Plaintext
Raw Normal View History

2022-12-06 00:34:41 +03:00
================================================================================
2022-12-07 23:22:40 +03:00
Simple shape key
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 00:07:26 +03:00
foo
2022-12-04 03:13:40 +03:00
bar
2022-12-04 00:07:26 +03:00
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 00:07:26 +03:00
2022-12-04 03:13:40 +03:00
(source_file
(shape (shape_key))
(shape (shape_key))
2022-12-04 03:13:40 +03:00
)
2022-12-04 00:07:26 +03:00
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-07 23:22:40 +03:00
Complex shape key
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:13:40 +03:00
Foo bar
-Biz-baz-
2022-12-04 00:07:26 +03:00
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 00:07:26 +03:00
(source_file
(shape (shape_key))
(shape (shape_key))
2022-12-04 03:13:40 +03:00
)
2022-12-07 23:14:25 +03:00
================================================================================
Use quoted string as a shape key
================================================================================
2022-12-07 23:22:40 +03:00
'foo'
2022-12-07 23:14:25 +03:00
--------------------------------------------------------------------------------
(source_file
(shape (shape_key (string)))
2022-12-07 23:14:25 +03:00
)
2022-12-04 00:07:26 +03:00
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-07 23:14:25 +03:00
Define multiple shapes using semicolons
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:13:40 +03:00
a;b;c
2022-12-04 00:07:26 +03:00
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 00:07:26 +03:00
(source_file
(shape (shape_key))
(shape (shape_key))
(shape (shape_key))
2022-12-04 03:13:40 +03:00
)
2022-12-04 00:07:26 +03:00
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-07 23:22:40 +03:00
Labeled shapes
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:13:40 +03:00
a: Foo Bar
a: Foo Bar; b: Biz Baz
2022-12-04 00:07:26 +03:00
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 00:07:26 +03:00
(source_file
(shape (shape_key) (label))
(shape (shape_key) (label))
(shape (shape_key) (label))
2022-12-04 03:13:40 +03:00
)
2022-12-04 00:07:26 +03:00
2022-12-06 00:53:06 +03:00
================================================================================
It should skip white spaces
================================================================================
foo
bar : Foo Bar; baz
--------------------------------------------------------------------------------
(source_file
(shape (shape_key))
(shape (shape_key) (label))
(shape (shape_key))
2022-12-06 00:53:06 +03:00
)
2022-12-06 12:32:50 +03:00
================================================================================
Use quoted string as shape key and label
2022-12-06 12:32:50 +03:00
================================================================================
'foo': "Label"
2022-12-06 12:41:41 +03:00
--------------------------------------------------------------------------------
(source_file
(shape (shape_key (string)) (label (string)))
2022-12-06 12:41:41 +03:00
)
2022-12-07 18:52:19 +03:00