Enum solang_parser::pt::SourceUnitPart
source · pub enum SourceUnitPart {
Show 13 variants
PragmaDirective(Loc, Option<Identifier>, Option<StringLiteral>),
ImportDirective(Import),
ContractDefinition(Box<ContractDefinition>),
EnumDefinition(Box<EnumDefinition>),
StructDefinition(Box<StructDefinition>),
EventDefinition(Box<EventDefinition>),
ErrorDefinition(Box<ErrorDefinition>),
FunctionDefinition(Box<FunctionDefinition>),
VariableDefinition(Box<VariableDefinition>),
TypeDefinition(Box<TypeDefinition>),
Annotation(Box<Annotation>),
Using(Box<Using>),
StraySemicolon(Loc),
}
Expand description
A parse tree part.
Variants§
PragmaDirective(Loc, Option<Identifier>, Option<StringLiteral>)
A pragma directive.
pragma <1> <2>;
1
and 2
are None
only if an error occurred during parsing.
ImportDirective(Import)
An import directive.
ContractDefinition(Box<ContractDefinition>)
A contract definition.
EnumDefinition(Box<EnumDefinition>)
An enum definition.
StructDefinition(Box<StructDefinition>)
A struct definition.
EventDefinition(Box<EventDefinition>)
An event definition.
ErrorDefinition(Box<ErrorDefinition>)
An error definition.
FunctionDefinition(Box<FunctionDefinition>)
A function definition.
VariableDefinition(Box<VariableDefinition>)
A variable definition.
TypeDefinition(Box<TypeDefinition>)
A type definition.
Annotation(Box<Annotation>)
An annotation.
Using(Box<Using>)
A using
directive.
StraySemicolon(Loc)
A stray semicolon.
Trait Implementations§
source§impl Clone for SourceUnitPart
impl Clone for SourceUnitPart
source§fn clone(&self) -> SourceUnitPart
fn clone(&self) -> SourceUnitPart
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CodeLocation for SourceUnitPart
impl CodeLocation for SourceUnitPart
source§impl Debug for SourceUnitPart
impl Debug for SourceUnitPart
source§impl Display for SourceUnitPart
impl Display for SourceUnitPart
source§impl PartialEq for SourceUnitPart
impl PartialEq for SourceUnitPart
source§fn eq(&self, other: &SourceUnitPart) -> bool
fn eq(&self, other: &SourceUnitPart) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SourceUnitPart
impl StructuralEq for SourceUnitPart
impl StructuralPartialEq for SourceUnitPart
Auto Trait Implementations§
impl RefUnwindSafe for SourceUnitPart
impl Send for SourceUnitPart
impl Sync for SourceUnitPart
impl Unpin for SourceUnitPart
impl UnwindSafe for SourceUnitPart
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