Enum ezno_parser::statements::Statement
source · pub enum Statement {
Show 17 variants
Expression(MultipleExpression),
Block(Block),
Debugger(Span),
IfStatement(IfStatement),
ForLoopStatement(ForLoopStatement),
SwitchStatement(SwitchStatement),
WhileStatement(WhileStatement),
DoWhileStatement(DoWhileStatement),
Return(Keyword<Return>, Option<MultipleExpression>),
Continue(Option<String>, Span),
Break(Option<String>, Span),
Throw(Keyword<Throw>, Box<Expression>),
Comment(String, Span),
MultiLineComment(String, Span),
Labelled {
position: Span,
name: String,
statement: Box<Statement>,
},
VarVariable(VarVariableStatement),
Cursor(CursorId<Statement>, Span),
}
Expand description
A statement Throw is on Expression (non-standard)
Variants§
Expression(MultipleExpression)
Block(Block)
{ … } statement
Debugger(Span)
IfStatement(IfStatement)
ForLoopStatement(ForLoopStatement)
SwitchStatement(SwitchStatement)
WhileStatement(WhileStatement)
DoWhileStatement(DoWhileStatement)
Return(Keyword<Return>, Option<MultipleExpression>)
Continue(Option<String>, Span)
Break(Option<String>, Span)
Throw(Keyword<Throw>, Box<Expression>)
e.g throw ...
Comment(String, Span)
MultiLineComment(String, Span)
Labelled
VarVariable(VarVariableStatement)
Cursor(CursorId<Statement>, Span)
TODO under cfg
Implementations§
Trait Implementations§
source§impl ASTNode for Statement
impl ASTNode for Statement
source§fn get_position(&self) -> Cow<'_, Span>
fn get_position(&self) -> Cow<'_, Span>
Returns position of node as span AS IT WAS PARSED. May be none if AST was doesn’t match anything in source
fn from_reader( reader: &mut impl TokenReader<TSXToken, Span>, state: &mut ParsingState, settings: &ParseSettings ) -> ParseResult<Self>
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, settings: &ToStringSettingsAndData, depth: u8 )
source§fn from_string(
source: String,
settings: ParseSettings,
source_id: SourceId,
offset: Option<usize>,
cursors: Vec<(usize, EmptyCursorId)>
) -> ParseResult<ParseOutput<Self>>
fn from_string( source: String, settings: ParseSettings, source_id: SourceId, offset: Option<usize>, cursors: Vec<(usize, EmptyCursorId)> ) -> ParseResult<ParseOutput<Self>>
From string, with default impl to call abstract method from_reader
source§fn to_string(&self, settings: &ToStringSettingsAndData) -> String
fn to_string(&self, settings: &ToStringSettingsAndData) -> String
Returns structure as valid string
source§impl From<DoWhileStatement> for Statement
impl From<DoWhileStatement> for Statement
source§fn from(item: DoWhileStatement) -> Statement
fn from(item: DoWhileStatement) -> Statement
Converts to this type from the input type.
source§impl From<ForLoopStatement> for Statement
impl From<ForLoopStatement> for Statement
source§fn from(item: ForLoopStatement) -> Statement
fn from(item: ForLoopStatement) -> Statement
Converts to this type from the input type.
source§impl From<IfStatement> for Statement
impl From<IfStatement> for Statement
source§fn from(item: IfStatement) -> Statement
fn from(item: IfStatement) -> Statement
Converts to this type from the input type.
source§impl From<MultipleExpression> for Statement
impl From<MultipleExpression> for Statement
source§fn from(item: MultipleExpression) -> Statement
fn from(item: MultipleExpression) -> Statement
Converts to this type from the input type.
source§impl From<Statement> for BlockOrSingleStatement
impl From<Statement> for BlockOrSingleStatement
source§impl From<SwitchStatement> for Statement
impl From<SwitchStatement> for Statement
source§fn from(item: SwitchStatement) -> Statement
fn from(item: SwitchStatement) -> Statement
Converts to this type from the input type.
source§impl From<VarVariableStatement> for Statement
impl From<VarVariableStatement> for Statement
source§fn from(item: VarVariableStatement) -> Statement
fn from(item: VarVariableStatement) -> Statement
Converts to this type from the input type.
source§impl From<WhileStatement> for Statement
impl From<WhileStatement> for Statement
source§fn from(item: WhileStatement) -> Statement
fn from(item: WhileStatement) -> Statement
Converts to this type from the input type.
source§impl PartialEq<Statement> for Statement
impl PartialEq<Statement> for Statement
source§impl SelfRustTokenize for Statement
impl SelfRustTokenize for Statement
fn append_to_token_stream(&self, token_stream: &mut TokenStream)
source§fn to_tokens(&self) -> TokenStream
fn to_tokens(&self) -> TokenStream
Returns the tokens used to construct self