dust/tree-sitter-dust/corpus/structure.txt

82 lines
1.9 KiB
Plaintext
Raw Normal View History

2023-11-11 01:44:03 +00:00
================================================================================
Simple Structure
2023-11-11 01:44:03 +00:00
================================================================================
struct { answer = 42 }
2023-11-11 01:44:03 +00:00
--------------------------------------------------------------------------------
(root
2023-11-11 01:44:03 +00:00
(statement
(expression
(value
(structure
2023-11-11 01:44:03 +00:00
(identifier)
(statement
(expression
(value
(integer)))))))))
2023-12-20 23:29:18 +00:00
================================================================================
Structure with Types
2023-12-20 23:29:18 +00:00
================================================================================
struct {
2023-12-20 23:29:18 +00:00
answer <num> = 42
stuff <[str]> = [ "some" "stuff" ]
}
--------------------------------------------------------------------------------
(root
(statement
(expression
(value
(structure
2023-12-20 23:29:18 +00:00
(identifier)
(type_definition
(type))
(statement
(expression
(value
(integer))))
(identifier)
(type_definition
(type
(type)))
(statement
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(string))))))))))))
2023-11-11 01:44:03 +00:00
================================================================================
Nested Structures
2023-11-11 01:44:03 +00:00
================================================================================
struct {
bar <Bar>
baz <Baz>
2023-11-28 16:01:38 +00:00
}
2023-11-11 01:44:03 +00:00
--------------------------------------------------------------------------------
(root
2023-11-11 01:44:03 +00:00
(statement
(expression
(value
(structure
(identifier)
(type_definition
(type
(identifier)))
(identifier)
(type_definition
(type
(identifier))))))))