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

224 lines
4.5 KiB
Text

================================================================================
Simple connection
================================================================================
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)
)
)
================================================================================
Formatted connection
================================================================================
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)
)
)
================================================================================
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)
)
)
================================================================================
Complex identifier connection
================================================================================
Foo Bar -- Biz Baz
-Bar-Foo- <- -Baz-Biz-
--------------------------------------------------------------------------------
(source_file
(connection
(shape_key)
(arrow)
(shape_key)
)
(connection
(shape_key)
(arrow)
(shape_key)
)
)
================================================================================
Inline connection
================================================================================
foo--bar->biz->baz
--------------------------------------------------------------------------------
(source_file
(connection
(shape_key)
(arrow)
(shape_key)
(arrow)
(shape_key)
(arrow)
(shape_key)
)
)
================================================================================
Many connections inline
================================================================================
foo--bar;biz->baz
--------------------------------------------------------------------------------
(source_file
(connection
(shape_key)
(arrow)
(shape_key)
)
(connection
(shape_key)
(arrow)
(shape_key)
)
)
================================================================================
Labeled connections
================================================================================
foo--bar: Question?
bar -> baz: Yes
--------------------------------------------------------------------------------
(source_file
(connection
(shape_key)
(arrow)
(shape_key)
(label)
)
(connection
(shape_key)
(arrow)
(shape_key)
(label)
)
)
================================================================================
Connection of shapes inside a containers
================================================================================
foo.biz.baz -> bar.baz.biz: Label
--------------------------------------------------------------------------------
(source_file
(connection
(container_key) (dot) (container_key) (dot) (shape_key)
(arrow)
(container_key) (dot) (container_key) (dot) (shape_key)
(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)
)
)
)
)
)