pub enum Expression {
Show 15 variants
AddressRange {
end: i128,
start: i128,
},
ByteArray(Vec<u8>),
BaseType(BaseType),
Integer(Integer),
Allow,
Number(i128),
DefaultNumber(Option<i128>),
CatchAllNumber(Option<i128>),
String(Istr),
Access(Access),
ByteOrder(ByteOrder),
TypeReference(Ident),
SubNode(NodeId),
Auto,
AddressMode(AddressMode),
}Variants§
AddressRange
ByteArray(Vec<u8>)
BaseType(BaseType)
Integer(Integer)
Allow
Number(i128)
DefaultNumber(Option<i128>)
CatchAllNumber(Option<i128>)
String(Istr)
Access(Access)
ByteOrder(ByteOrder)
TypeReference(Ident)
SubNode(NodeId)
Auto
AddressMode(AddressMode)
Implementations§
Source§impl Expression
impl Expression
pub fn as_range(&self) -> Option<(i128, i128)>
pub fn as_byte_order(&self) -> Option<ByteOrder>
pub fn as_access(&self) -> Option<Access>
pub fn as_integer(&self) -> Option<Integer>
pub fn as_unsigned_integer(&self) -> Option<Integer>
pub fn as_number(&self) -> Option<i128>
pub fn as_string(&self) -> Option<Istr>
pub fn as_address_mode(&self) -> Option<AddressMode>
pub fn as_sub_node(&self) -> Option<NodeId>
pub fn print_formatted(&self, ast: &Ast) -> Cow<'static, str>
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§impl Debug for Expression
impl Debug for Expression
Source§impl Display for Expression
impl Display for Expression
Source§impl SemanticTokenObject for Expression
impl SemanticTokenObject for Expression
type Context = Ast
fn to_tokens_in(&self, ctx: &Self::Context, tokens: &mut Vec<SemanticToken<'_>>)
fn to_tokens(&self, ctx: &Self::Context) -> Vec<SemanticToken<'_>>
fn to_respanned_tokens<'src>( &self, source: &'src str, object_span: Span, ctx: &Self::Context, ) -> Vec<Spanned<SemanticToken<'src>>>
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T> SpanExt for T
impl<T> SpanExt for T
fn with_span(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
Source§fn spanned(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
fn spanned(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
Same as
Self::with_span, but can avoid name collisionsfn with_dummy_span(self) -> Spanned<Self>where
Self: Sized,
fn into_with_dummy_span<T>(self) -> Spanned<T>where
Self: Into<T>,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.