2024-02-15 01:23:33 +00:00
|
|
|
================================================================================
|
|
|
|
Simple Enum
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
enum Foobar {
|
|
|
|
Foo,
|
|
|
|
Bar,
|
|
|
|
}
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(type_definition
|
|
|
|
(enum_definition
|
|
|
|
(identifier)
|
|
|
|
(identifier)
|
|
|
|
(identifier))))))
|
2024-02-15 01:23:33 +00:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Nested Enum
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
enum Foobar {
|
|
|
|
Foo(str),
|
|
|
|
Bar(enum BazBuff {
|
|
|
|
Baz,
|
|
|
|
Buff,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(type_definition
|
|
|
|
(enum_definition
|
|
|
|
(identifier)
|
|
|
|
(identifier)
|
|
|
|
(type)
|
|
|
|
(identifier)
|
|
|
|
(type_definition
|
|
|
|
(enum_definition
|
|
|
|
(identifier)
|
|
|
|
(identifier)
|
|
|
|
(identifier))))))))
|
2024-02-15 01:23:33 +00:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Simple Enum Instance
|
|
|
|
================================================================================
|
|
|
|
|
2024-02-15 07:22:04 +00:00
|
|
|
Foobar::Foo
|
2024-02-15 01:23:33 +00:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(enum_instance
|
|
|
|
(identifier)
|
|
|
|
(identifier)))))))
|
2024-02-15 01:23:33 +00:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Nested Enum Instance
|
|
|
|
================================================================================
|
|
|
|
|
2024-02-15 07:22:04 +00:00
|
|
|
FooBar::Bar(BazBuf::Baz(123))
|
2024-02-15 01:23:33 +00:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(enum_instance
|
|
|
|
(identifier)
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(enum_instance
|
|
|
|
(identifier)
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer))))))))))))
|