1
0
dust/tree-sitter-dust/corpus/struct.txt

74 lines
1.8 KiB
Plaintext

================================================================================
Simple Structure
================================================================================
struct Foo {
x <int>
y <float>
}
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(type_definition
(struct_definition
(identifier)
(identifier)
(type_specification
(type))
(identifier)
(type_specification
(type)))))))
================================================================================
Nested Structure
================================================================================
struct Foo {
x <int>
y <float> = 0.0
bar <Bar> = Bar::{
baz = 42
}
}
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(type_definition
(struct_definition
(identifier)
(identifier)
(type_specification
(type))
(identifier)
(type_specification
(type))
(statement
(statement_kind
(expression
(value
(float)))))
(identifier)
(type_specification
(type
(identifier)))
(statement
(statement_kind
(expression
(value
(struct_instance
(identifier)
(map
(identifier)
(statement
(statement_kind
(expression
(value
(integer))))))))))))))))