Enum ezno_parser::statements::Statement
source · pub enum Statement {
Show 19 variants
Expression(MultipleExpression),
Block(Block),
Debugger(Span),
If(IfStatement),
ForLoop(ForLoopStatement),
Switch(SwitchStatement),
WhileLoop(WhileStatement),
DoWhileLoop(DoWhileStatement),
TryCatch(TryCatchStatement),
Return(ReturnStatement),
Continue(Option<String>, Span),
Break(Option<String>, Span),
Throw(ThrowStatement),
Comment(String, Span),
MultiLineComment(String, Span),
Labelled {
position: Span,
name: String,
statement: Box<Statement>,
},
VarVariable(VarVariableStatement),
Empty(Span),
AestheticSemiColon(Span),
}
Expand description
A statement. See [Declaration]s and [StatementAndDeclaration] for more
Variants§
Expression(MultipleExpression)
Block(Block)
{ … } statement
Debugger(Span)
If(IfStatement)
ForLoop(ForLoopStatement)
Switch(SwitchStatement)
WhileLoop(WhileStatement)
DoWhileLoop(DoWhileStatement)
TryCatch(TryCatchStatement)
Return(ReturnStatement)
Continue(Option<String>, Span)
Break(Option<String>, Span)
Throw(ThrowStatement)
e.g throw ...
Comment(String, Span)
MultiLineComment(String, Span)
Labelled
VarVariable(VarVariableStatement)
Empty(Span)
AestheticSemiColon(Span)
Lol
Implementations§
Trait Implementations§
source§impl ASTNode for Statement
impl ASTNode for Statement
source§fn get_position(&self) -> Span
fn get_position(&self) -> Span
Returns position of node as span AS IT WAS PARSED. May be
Span::NULL
if AST was doesn’t match anything in sourcefn from_reader( reader: &mut impl TokenReader<TSXToken, TokenStart>, state: &mut ParsingState, options: &ParseOptions ) -> ParseResult<Self>
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, options: &ToStringOptions, local: LocalToStringInformation )
source§fn from_string(script: String, options: ParseOptions) -> ParseResult<Self>
fn from_string(script: String, options: ParseOptions) -> ParseResult<Self>
From string, with default impl to call abstract method
from_reader
fn from_string_with_options( script: String, options: ParseOptions, offset: Option<u32> ) -> ParseResult<(Self, ParsingState)>
source§fn to_string(&self, options: &ToStringOptions) -> String
fn to_string(&self, options: &ToStringOptions) -> String
Returns structure as valid string
source§impl<'a> From<&'a mut Statement> for BlockItemMut<'a>
impl<'a> From<&'a mut Statement> for BlockItemMut<'a>
source§impl From<DoWhileStatement> for Statement
impl From<DoWhileStatement> for Statement
source§fn from(item: DoWhileStatement) -> Self
fn from(item: DoWhileStatement) -> Self
Converts to this type from the input type.
source§impl From<ForLoopStatement> for Statement
impl From<ForLoopStatement> for Statement
source§fn from(item: ForLoopStatement) -> Self
fn from(item: ForLoopStatement) -> Self
Converts to this type from the input type.
source§impl From<IfStatement> for Statement
impl From<IfStatement> for Statement
source§fn from(item: IfStatement) -> Self
fn from(item: IfStatement) -> Self
Converts to this type from the input type.
source§impl From<MultipleExpression> for Statement
impl From<MultipleExpression> for Statement
source§fn from(item: MultipleExpression) -> Self
fn from(item: MultipleExpression) -> Self
Converts to this type from the input type.
source§impl From<ReturnStatement> for Statement
impl From<ReturnStatement> for Statement
source§fn from(item: ReturnStatement) -> Self
fn from(item: ReturnStatement) -> Self
Converts to this type from the input type.
source§impl From<Statement> for BlockOrSingleStatement
impl From<Statement> for BlockOrSingleStatement
source§impl From<Statement> for StatementOrDeclaration
impl From<Statement> for StatementOrDeclaration
source§impl From<SwitchStatement> for Statement
impl From<SwitchStatement> for Statement
source§fn from(item: SwitchStatement) -> Self
fn from(item: SwitchStatement) -> Self
Converts to this type from the input type.
source§impl From<ThrowStatement> for Statement
impl From<ThrowStatement> for Statement
source§fn from(item: ThrowStatement) -> Self
fn from(item: ThrowStatement) -> Self
Converts to this type from the input type.
source§impl From<TryCatchStatement> for Statement
impl From<TryCatchStatement> for Statement
source§fn from(item: TryCatchStatement) -> Self
fn from(item: TryCatchStatement) -> Self
Converts to this type from the input type.
source§impl From<VarVariableStatement> for Statement
impl From<VarVariableStatement> for Statement
source§fn from(item: VarVariableStatement) -> Self
fn from(item: VarVariableStatement) -> Self
Converts to this type from the input type.
source§impl From<WhileStatement> for Statement
impl From<WhileStatement> for Statement
source§fn from(item: WhileStatement) -> Self
fn from(item: WhileStatement) -> Self
Converts to this type from the input type.
source§impl PartialEq for Statement
impl PartialEq 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
source§impl<'try_into_ref> TryInto<&'try_into_ref DoWhileStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref DoWhileStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref ForLoopStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref ForLoopStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref IfStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref IfStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref MultipleExpression> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref MultipleExpression> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref ReturnStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref ReturnStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref SwitchStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref SwitchStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref ThrowStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref ThrowStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref TryCatchStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref TryCatchStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref VarVariableStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref VarVariableStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref WhileStatement> for &'try_into_ref Statement
impl<'try_into_ref> TryInto<&'try_into_ref WhileStatement> for &'try_into_ref Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut DoWhileStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut DoWhileStatement> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut ForLoopStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut ForLoopStatement> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut IfStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut IfStatement> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut MultipleExpression> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut MultipleExpression> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut ReturnStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut ReturnStatement> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut SwitchStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut SwitchStatement> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut ThrowStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut ThrowStatement> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut TryCatchStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut TryCatchStatement> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut VarVariableStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut VarVariableStatement> for &'try_into_ref mut Statement
source§impl<'try_into_ref> TryInto<&'try_into_ref mut WhileStatement> for &'try_into_ref mut Statement
impl<'try_into_ref> TryInto<&'try_into_ref mut WhileStatement> for &'try_into_ref mut Statement
source§impl Visitable for Statement
impl Visitable for Statement
fn visit<TData>( &self, visitors: &mut (impl VisitorReceiver<TData> + ?Sized), data: &mut TData, options: &VisitOptions, chain: &mut Annex<'_, Chain> )
fn visit_mut<TData>( &mut self, visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), data: &mut TData, options: &VisitOptions, chain: &mut Annex<'_, Chain> )
impl Eq for Statement
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more