use oak_core::{ElementType, UniversalElementRole};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ActionScriptElementType {
Whitespace,
Newline,
Comment,
Identifier,
StringLiteral,
CharLiteral,
NumberLiteral,
BooleanLiteral,
NullLiteral,
As,
Break,
Case,
Catch,
Class,
Const,
Continue,
Default,
Delete,
Do,
Else,
Extends,
False,
Finally,
For,
Function,
If,
Implements,
Import,
In,
Instanceof,
Interface,
Internal,
Is,
Native,
New,
Null,
Package,
Private,
Protected,
Public,
Return,
Static,
Super,
Switch,
This,
Throw,
True,
Try,
Typeof,
Use,
Var,
Void,
While,
With,
Each,
Get,
Set,
Namespace,
Include,
Dynamic,
Final,
Override,
Array,
Boolean,
Date,
Number,
ObjectType,
RegExp,
StringType,
Uint,
Vector,
VoidType,
Xml,
XmlList,
Plus,
Minus,
Star,
Slash,
Percent,
Equal,
EqualEqual,
EqualEqualEqual,
NotEqual,
NotEqualEqual,
LessThan,
LessEqual,
GreaterThan,
GreaterEqual,
LogicalAnd,
LogicalOr,
LogicalNot,
BitwiseAnd,
BitwiseOr,
BitwiseXor,
BitwiseNot,
LeftShift,
RightShift,
UnsignedRightShift,
Increment,
Decrement,
PlusAssign,
MinusAssign,
StarAssign,
SlashAssign,
PercentAssign,
LeftShiftAssign,
RightShiftAssign,
UnsignedRightShiftAssign,
BitwiseAndAssign,
BitwiseOrAssign,
BitwiseXorAssign,
Question,
Colon,
Dot,
Arrow,
LeftParen,
RightParen,
LeftBrace,
RightBrace,
LeftBracket,
RightBracket,
Semicolon,
Comma,
At,
Hash,
Dollar,
Ampersand,
Backslash,
Quote,
DoubleQuote,
Backtick,
Eof,
Program,
Block,
Variable,
FunctionCall,
MethodCall,
PropertyAccess,
ArrayAccess,
ParameterList,
UseItem,
ModuleItem,
StructItem,
EnumItem,
FunctionType,
Root,
Statement,
Expression,
Assignment,
ConditionalExpression,
BinaryExpression,
UnaryExpression,
IfStatement,
ForStatement,
WhileStatement,
DoWhileStatement,
SwitchStatement,
TryStatement,
ThrowStatement,
ReturnStatement,
BreakStatement,
ContinueStatement,
Error,
LiteralExpression,
IdentifierExpression,
ParenthesizedExpression,
SourceFile,
BlockExpression,
LetStatement,
IfExpression,
WhileExpression,
LoopExpression,
ForExpression,
CallExpression,
IndexExpression,
FieldExpression,
}
impl ElementType for ActionScriptElementType {
type Role = UniversalElementRole;
fn role(&self) -> Self::Role {
match self {
Self::Root => UniversalElementRole::Root,
Self::SourceFile => UniversalElementRole::Root,
Self::Error => UniversalElementRole::Error,
_ => UniversalElementRole::None,
}
}
}
impl From<crate::lexer::token_type::ActionScriptTokenType> for ActionScriptElementType {
fn from(token: crate::lexer::token_type::ActionScriptTokenType) -> Self {
unsafe { std::mem::transmute(token) }
}
}