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

81 lines
2.1 KiB
Plaintext
Raw Normal View History

2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 23:45:53 +03:00
Root attribute
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 18:35:50 +03:00
direction: value
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 18:35:50 +03:00
(source_file
2022-12-04 23:45:53 +03:00
(attr_key) (attr_value)
2022-12-04 18:35:50 +03:00
)
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 23:45:53 +03:00
Inline shape attribute
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 23:45:53 +03:00
foo.shape: oval
2022-12-05 00:26:24 +03:00
foo.bar.baz.shape: oval
2022-12-04 23:45:53 +03:00
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 23:45:53 +03:00
(source_file
2022-12-05 00:26:24 +03:00
(shape (identifier) (dot) (attr_key) (attr_value))
(shape (identifier) (dot) (identifier) (dot) (identifier) (dot) (attr_key) (attr_value))
2022-12-04 23:45:53 +03:00
)
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 23:45:53 +03:00
Inline style attribute
2022-12-06 00:34:41 +03:00
================================================================================
2022-12-04 23:45:53 +03:00
foo.style.opacity: 5
2022-12-06 00:34:41 +03:00
--------------------------------------------------------------------------------
2022-12-04 23:45:53 +03:00
(source_file
2022-12-05 00:26:24 +03:00
(shape (identifier) (dot) (attr_key) (dot) (attr_key) (attr_value))
2022-12-04 23:45:53 +03:00
)
2022-12-06 11:57:59 +03:00
================================================================================
Block style attributes
================================================================================
foo.style: {
opacity: 5
2022-12-06 12:32:50 +03:00
2022-12-06 11:57:59 +03:00
fill: red;
}
--------------------------------------------------------------------------------
(source_file
(shape
(identifier) (dot) (attr_key)
(block
(attr_key) (attr_value)
(attr_key) (attr_value)
)
)
)
================================================================================
Inline block style attributes
================================================================================
foo.style: { opacity: 5; fill: red; }
foo.style: { opacity: 5 }
--------------------------------------------------------------------------------
(source_file
(shape
(identifier) (dot) (attr_key)
(block
(attr_key) (attr_value)
(attr_key) (attr_value)
)
)
(shape
(identifier) (dot) (attr_key)
(block
(attr_key) (attr_value)
)
)
)