91 lines
2.2 KiB
Plaintext
91 lines
2.2 KiB
Plaintext
================================================================================
|
|
Simple Enum
|
|
================================================================================
|
|
|
|
enum Foobar {
|
|
Foo,
|
|
Bar,
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(statement_kind
|
|
(type_definition
|
|
(enum_definition
|
|
(identifier)
|
|
(identifier)
|
|
(identifier))))))
|
|
|
|
================================================================================
|
|
Nested Enum
|
|
================================================================================
|
|
|
|
enum Foobar {
|
|
Foo(str),
|
|
Bar(enum BazBuff {
|
|
Baz,
|
|
Buff,
|
|
})
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(statement_kind
|
|
(type_definition
|
|
(enum_definition
|
|
(identifier)
|
|
(identifier)
|
|
(type)
|
|
(identifier)
|
|
(type_definition
|
|
(enum_definition
|
|
(identifier)
|
|
(identifier)
|
|
(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))))))))))))
|