Enum ezno_parser::statements::Statement
source · pub enum Statement {
Show 19 variants
Expression(MultipleExpression),
Block(Block),
Debugger(Span),
IfStatement(IfStatement),
ForLoopStatement(ForLoopStatement),
SwitchStatement(SwitchStatement),
WhileStatement(WhileStatement),
DoWhileStatement(DoWhileStatement),
TryCatchStatement(TryCatchStatement),
Return(Keyword<Return>, Option<MultipleExpression>),
Continue(Option<String>, Span),
Break(Option<String>, Span),
Throw(Keyword<Throw>, Box<MultipleExpression>),
Comment(String, Span),
MultiLineComment(String, Span),
Labelled {
position: Span,
name: String,
statement: Box<Statement>,
},
VarVariable(VarVariableStatement),
Empty(Span),
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)
TryCatchStatement(TryCatchStatement)
Return(Keyword<Return>, Option<MultipleExpression>)
Continue(Option<String>, Span)
Break(Option<String>, Span)
Throw(Keyword<Throw>, Box<MultipleExpression>)
e.g throw ...
Comment(String, Span)
MultiLineComment(String, Span)
Labelled
VarVariable(VarVariableStatement)
Empty(Span)
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: &ParseOptions ) -> ParseResult<Self>
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, settings: &ToStringOptions, depth: u8 )
source§fn from_string(
source: String,
settings: ParseOptions,
source_id: SourceId,
offset: Option<usize>,
cursors: Vec<(usize, EmptyCursorId)>
) -> ParseResult<Self>
fn from_string( source: String, settings: ParseOptions, source_id: SourceId, offset: Option<usize>, cursors: Vec<(usize, EmptyCursorId)> ) -> ParseResult<Self>
From string, with default impl to call abstract method from_reader
source§fn to_string(&self, settings: &ToStringOptions) -> String
fn to_string(&self, settings: &ToStringOptions) -> 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<TryCatchStatement> for Statement
impl From<TryCatchStatement> for Statement
source§fn from(item: TryCatchStatement) -> Statement
fn from(item: TryCatchStatement) -> 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
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 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 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 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 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, settings: &VisitSettings, chain: &mut Annex<'_, Chain> )
fn visit_mut<TData>( &mut self, visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), data: &mut TData, settings: &VisitSettings, chain: &mut Annex<'_, Chain> )
impl Eq for Statement
impl SelfVisitable for Statement
impl SelfVisitableMut for Statement
Auto Trait Implementations§
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