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

71 lines
1.7 KiB
Plaintext

================================================================================
Simple Structure
================================================================================
struct {
x <int>
y <float>
}
--------------------------------------------------------------------------------
(root
(statement
(expression
(value
(structure
(identifier)
(type_specification
(type))
(identifier)
(type_specification
(type)))))))
================================================================================
Complex Structure
================================================================================
Foo = struct {
x <int>
y <float> = 0.0
bar <Bar> = new Bar {
baz = 42
}
}
--------------------------------------------------------------------------------
(root
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(structure
(identifier)
(type_specification
(type))
(identifier)
(type_specification
(type))
(statement
(expression
(value
(float))))
(identifier)
(type_specification
(type
(identifier)))
(statement
(expression
(new
(identifier)
(identifier)
(statement
(expression
(value
(integer))))))))))))))