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

229 lines
4.9 KiB
Text
Raw Normal View History

2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:21:42 +03:00
Simple connection
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 00:07:26 +03:00
foo--bar
2022-12-04 03:21:42 +03:00
biz->baz
biz<->baz
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
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 00:07:26 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
)
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
)
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
)
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
)
)
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 18:35:37 +03:00
Formatted connection
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 18:35:37 +03:00
foo -- bar
biz -> baz
biz <-> baz
biz <- baz
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 18:35:37 +03:00
(source_file
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 18:35:37 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 18:35:37 +03:00
)
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 18:35:37 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 18:35:37 +03:00
)
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 18:35:37 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 18:35:37 +03:00
)
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 18:35:37 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 18:35:37 +03:00
)
)
================================================================================
Connection with looooong arrow
================================================================================
foo ----------- bar
biz ----------> baz
biz <---------> baz
biz <---------- baz
--------------------------------------------------------------------------------
(source_file
(connection
(shape_key)
(arrow)
(shape_key)
)
(connection
(shape_key)
(arrow)
(shape_key)
)
(connection
(shape_key)
(arrow)
(shape_key)
)
(connection
(shape_key)
(arrow)
(shape_key)
)
)
2022-12-04 18:35:37 +03:00
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:21:42 +03:00
Complex identifier connection
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:21:42 +03:00
Foo Bar -- Biz Baz
-Bar-Foo- <- -Baz-Biz-
imAShape -- im_a_shape
im_a_shape -- im$AShape
im a shape -- i'm $a shape
i'm a shape -- a-sh$ape
a-shape -- im a sh$ape
foo' 'bar -- baz
2022-12-04 03:21:42 +03:00
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 03:21:42 +03:00
(source_file
(connection (shape_key) (arrow) (shape_key))
(connection (shape_key) (arrow) (shape_key))
(connection (shape_key) (arrow) (shape_key))
(connection (shape_key) (arrow) (shape_key))
(connection (shape_key) (arrow) (shape_key))
(connection (shape_key) (arrow) (shape_key))
(connection (shape_key) (arrow) (shape_key))
(connection (shape_key) (arrow) (shape_key))
2022-12-04 03:21:42 +03:00
)
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:21:42 +03:00
Inline connection
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:21:42 +03:00
foo--bar->biz->baz
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 03:21:42 +03:00
(source_file
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:21:42 +03:00
)
)
2022-12-04 03:25:38 +03:00
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:27:27 +03:00
Many connections inline
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 03:27:27 +03:00
foo--bar;biz->baz
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 03:27:27 +03:00
(source_file
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:27:27 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:27:27 +03:00
)
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:27:27 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:27:27 +03:00
)
)
2022-12-06 00:34:41 +03:00
================================================================================
Labeled connections
================================================================================
2022-12-04 03:25:38 +03:00
foo--bar: Question?
2022-12-06 00:34:41 +03:00
bar -> baz: Yes
2022-12-04 03:25:38 +03:00
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 03:25:38 +03:00
(source_file
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:25:38 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:25:38 +03:00
(label)
)
(connection
2022-12-07 23:14:25 +03:00
(shape_key)
2022-12-04 03:25:38 +03:00
(arrow)
2022-12-07 23:14:25 +03:00
(shape_key)
(label)
)
)
================================================================================
2022-12-08 01:15:09 +03:00
Connection of shapes inside a containers
2022-12-07 23:14:25 +03:00
================================================================================
foo.biz.baz -> bar.baz.biz: Label
--------------------------------------------------------------------------------
(source_file
(connection
2022-12-08 01:15:09 +03:00
(container_key) (dot) (container_key) (dot) (shape_key)
2022-12-07 23:14:25 +03:00
(arrow)
2022-12-08 01:15:09 +03:00
(container_key) (dot) (container_key) (dot) (shape_key)
2022-12-04 03:25:38 +03:00
(label)
)
)
================================================================================
Connection of shapes inside a block of container
================================================================================
foo.baz: {
foo -> biz: Label
}
--------------------------------------------------------------------------------
(source_file
(container
(container_key) (dot)
(container
(container_key)
(block
(connection
(shape_key)
(arrow)
(shape_key)
(label)
)
)
)
)
)