1
0
dust/tree-sitter-dust/corpus/enums.txt
2024-02-18 15:44:57 -05:00

130 lines
3.1 KiB
Plaintext

================================================================================
Simple Enum
================================================================================
enum Foobar {
Foo,
Bar,
}
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(type_definition
(enum_definition
(identifier)
(identifier)
(identifier))))))
================================================================================
Enum with Arguments
================================================================================
enum Foobar<T, U> {
Foo<T>,
Bar<U>,
}
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(type_definition
(enum_definition
(identifier)
(type_arguments
(type
(identifier))
(type
(identifier)))
(identifier)
(type_arguments
(type
(identifier)))
(identifier)
(type_arguments
(type
(identifier))))))))
================================================================================
Complex Enum
================================================================================
enum Foobar<T> {
Foo<Foo>,
Bar<int, float>,
Baz<Option<T>>,
}
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(type_definition
(enum_definition
(identifier)
(type_arguments
(type
(identifier)))
(identifier)
(type_arguments
(type
(identifier)))
(identifier)
(type_arguments
(type)
(type))
(identifier)
(type_arguments
(type
(identifier)
(type_arguments
(type
(identifier))))))))))
================================================================================
Simple Enum Instance
================================================================================
FooBar::Foo
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(expression
(value
(enum_instance
(identifier)
(identifier)))))))
================================================================================
Nested Enum Instance
================================================================================
FooBar::Bar(BazBuf::Baz(123))
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(expression
(value
(enum_instance
(identifier)
(identifier)
(expression
(value
(enum_instance
(identifier)
(identifier)
(expression
(value
(integer))))))))))))