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

256 lines
5 KiB
Text
Raw Permalink Normal View History

2023-06-16 00:43:30 +03:00
================================================================================
Declare empty classes keyword in the root
================================================================================
classes
--------------------------------------------------------------------------------
(source_file
(classes (keyword_classes))
)
================================================================================
Declare classes block with item block
================================================================================
classes: {
foo: {
style: {
fill: "#44C7B1"
}
}
}
--------------------------------------------------------------------------------
(source_file
(classes
(keyword_classes)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(block
(class_name)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(class_block
(attribute
(keyword_style)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(block
(attribute
(attr_key)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(attr_value
(string (string_fragment))
)
)
)
)
)
)
)
)
================================================================================
Declare classes block with item inline
================================================================================
classes: {
foo.style: {
fill: "#44C7B1"
}
}
--------------------------------------------------------------------------------
(source_file
(classes
(keyword_classes)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(block
(class_name)
(dot)
(attribute
(keyword_style)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(block
(attribute
(attr_key)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(attr_value
(string (string_fragment))
)
)
)
)
)
)
)
================================================================================
Declare classes inline with item inline
================================================================================
classes.foo.style: {
fill: "#44C7B1"
}
--------------------------------------------------------------------------------
(source_file
(classes
(keyword_classes)
(dot)
(class_name)
(dot)
(attribute
(keyword_style)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(block
(attribute
(attr_key)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(attr_value
(string (string_fragment))
)
)
)
)
)
)
================================================================================
Declare classes inline with item block
================================================================================
classes.foo: {
style: {
fill: "#44C7B1"
}
}
--------------------------------------------------------------------------------
(source_file
(classes
(keyword_classes)
(dot)
(class_name)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(class_block
(attribute
(keyword_style)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(block
(attribute
(attr_key)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(attr_value
(string (string_fragment))
)
)
)
)
)
)
)
================================================================================
Declare shape with a class
================================================================================
foo.class: biz
--------------------------------------------------------------------------------
(source_file
(shape
(shape_key)
(dot)
(attribute
(keyword_class)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(class_name)
)
)
)
================================================================================
Declare shape with many classes
================================================================================
fee.class: [biz]
2023-06-16 00:43:30 +03:00
foo.class: [biz; baz]
--------------------------------------------------------------------------------
(source_file
(shape
(shape_key)
(dot)
(attribute
(keyword_class)
2024-07-12 20:36:24 +03:00
(colon)
(class_list
(class_name)
)
)
)
2023-06-16 00:43:30 +03:00
(shape
(shape_key)
(dot)
(attribute
(keyword_class)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(class_list
(class_name)
(class_name)
)
)
)
)
================================================================================
Declare a class in the container
================================================================================
foo: {
class: biz
class: [biz]
class: [biz; baz]
class: [
biz
baz
]
2023-06-16 00:43:30 +03:00
}
--------------------------------------------------------------------------------
(source_file
(container
(container_key)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(block
(attribute
(keyword_class)
2024-07-12 20:36:24 +03:00
(colon)
2023-06-16 00:43:30 +03:00
(class_name)
)
(attribute
(keyword_class)
2024-07-12 20:36:24 +03:00
(colon)
(class_list
(class_name)
)
)
(attribute
(keyword_class)
2024-07-12 20:36:24 +03:00
(colon)
(class_list
(class_name)
(class_name)
)
)
(attribute
(keyword_class)
2024-07-12 20:36:24 +03:00
(colon)
(class_list
(class_name)
(class_name)
)
)
2023-06-16 00:43:30 +03:00
)
)
)