Enum cpclib_asm::parser::LocatedTokenInner
source · pub enum LocatedTokenInner {
Show 68 variants
Align(LocatedExpr, Option<LocatedExpr>),
Assert(LocatedExpr, Option<Vec<FormattedExpr>>),
AssemblerControl(LocatedAssemblerControlCommand),
Assign {
label: Z80Span,
expr: LocatedExpr,
op: Option<BinaryOperation>,
},
Bank(Option<LocatedExpr>),
Bankset(LocatedExpr),
Basic(Option<Vec<Z80Span>>, Option<Vec<LocatedExpr>>, Z80Span),
Break,
Breakpoint(Option<LocatedExpr>),
BuildCpr,
BuildSna(Option<SnapshotVersion>),
Charset(CharsetFormat),
Comment(Z80Span),
Confined(LocatedListing),
CrunchedSection(CrunchType, LocatedListing),
Defb(Vec<LocatedExpr>),
Defs(Vec<(LocatedExpr, Option<LocatedExpr>)>),
Defw(Vec<LocatedExpr>),
End,
Equ {
label: Z80Span,
expr: LocatedExpr,
},
Export(Vec<Z80Span>),
Fail(Option<Vec<FormattedExpr>>),
Field {
label: Z80Span,
expr: LocatedExpr,
},
For {
label: Z80Span,
start: LocatedExpr,
stop: LocatedExpr,
step: Option<LocatedExpr>,
listing: LocatedListing,
},
Function(Z80Span, Vec<Z80Span>, LocatedListing),
If(Vec<(LocatedTestKind, LocatedListing)>, Option<LocatedListing>),
Incbin {
fname: UnescapedString,
offset: Option<LocatedExpr>,
length: Option<LocatedExpr>,
extended_offset: Option<LocatedExpr>,
off: bool,
transformation: BinaryTransformation,
},
Include(UnescapedString, Option<Z80Span>, bool),
Iterate(Z80Span, Either<Vec<LocatedExpr>, LocatedExpr>, LocatedListing),
Label(Z80Span),
Let(Z80Span, Expr),
Limit(LocatedExpr),
List,
Macro {
name: Z80Span,
params: Vec<Z80Span>,
content: Z80Span,
flavor: AssemblerFlavor,
},
MacroCall(Z80Span, Vec<LocatedMacroParam>),
Map(LocatedExpr),
Module(Z80Span, LocatedListing),
MultiPop(Vec<LocatedDataAccess>),
MultiPush(Vec<LocatedDataAccess>),
Next {
label: Z80Span,
source: Z80Span,
expr: Option<LocatedExpr>,
},
NoExport(Vec<Z80Span>),
NoList,
OpCode(Mnemonic, Option<LocatedDataAccess>, Option<LocatedDataAccess>, Option<Register8>),
Org {
val1: LocatedExpr,
val2: Option<LocatedExpr>,
},
Pause,
Print(Vec<FormattedExpr>),
Protect(LocatedExpr, LocatedExpr),
Range(Z80Span, LocatedExpr, LocatedExpr),
Repeat(LocatedExpr, LocatedListing, Option<Z80Span>, Option<LocatedExpr>, Option<LocatedExpr>),
RepeatUntil(LocatedExpr, LocatedListing),
Return(LocatedExpr),
Rorg(LocatedExpr, LocatedListing),
Run(LocatedExpr, Option<LocatedExpr>),
Save {
filename: UnescapedString,
address: Option<LocatedExpr>,
size: Option<LocatedExpr>,
save_type: Option<SaveType>,
dsk_filename: Option<UnescapedString>,
side: Option<LocatedExpr>,
},
Section(Z80Span),
SetN {
label: Z80Span,
source: Z80Span,
expr: Option<LocatedExpr>,
},
Skip(LocatedExpr),
SnaInit(UnescapedString),
SnaSet(SnapshotFlag, FlagValue),
StableTicker(StableTickerAction<Z80Span>),
StartingIndex {
start: Option<LocatedExpr>,
step: Option<LocatedExpr>,
},
Str(Vec<LocatedExpr>),
Struct(Z80Span, Vec<(Z80Span, LocatedToken)>),
Switch(LocatedExpr, Vec<(LocatedExpr, LocatedListing, bool)>, Option<LocatedListing>),
Undef(Z80Span),
WaitNops(LocatedExpr),
WarningWrapper(Box<Self>, String),
While(LocatedExpr, LocatedListing),
}
Variants§
Align(LocatedExpr, Option<LocatedExpr>)
Assert(LocatedExpr, Option<Vec<FormattedExpr>>)
AssemblerControl(LocatedAssemblerControlCommand)
Assign
Bank(Option<LocatedExpr>)
Bankset(LocatedExpr)
Basic(Option<Vec<Z80Span>>, Option<Vec<LocatedExpr>>, Z80Span)
Break
Breakpoint(Option<LocatedExpr>)
BuildCpr
BuildSna(Option<SnapshotVersion>)
Charset(CharsetFormat)
Comment(Z80Span)
Confined(LocatedListing)
CrunchedSection(CrunchType, LocatedListing)
Defb(Vec<LocatedExpr>)
Defs(Vec<(LocatedExpr, Option<LocatedExpr>)>)
Defw(Vec<LocatedExpr>)
End
Equ
Export(Vec<Z80Span>)
Fail(Option<Vec<FormattedExpr>>)
Field
For
Function(Z80Span, Vec<Z80Span>, LocatedListing)
If(Vec<(LocatedTestKind, LocatedListing)>, Option<LocatedListing>)
Incbin
Fields
§
fname: UnescapedString
§
offset: Option<LocatedExpr>
§
length: Option<LocatedExpr>
§
extended_offset: Option<LocatedExpr>
§
transformation: BinaryTransformation
Include(UnescapedString, Option<Z80Span>, bool)
Iterate(Z80Span, Either<Vec<LocatedExpr>, LocatedExpr>, LocatedListing)
Label(Z80Span)
Let(Z80Span, Expr)
Limit(LocatedExpr)
List
Macro
MacroCall(Z80Span, Vec<LocatedMacroParam>)
Name, Parameters, FullSpan
Map(LocatedExpr)
Module(Z80Span, LocatedListing)
MultiPop(Vec<LocatedDataAccess>)
MultiPush(Vec<LocatedDataAccess>)
Next
NoExport(Vec<Z80Span>)
NoList
OpCode(Mnemonic, Option<LocatedDataAccess>, Option<LocatedDataAccess>, Option<Register8>)
Org
Pause
Print(Vec<FormattedExpr>)
Protect(LocatedExpr, LocatedExpr)
Range(Z80Span, LocatedExpr, LocatedExpr)
Repeat(LocatedExpr, LocatedListing, Option<Z80Span>, Option<LocatedExpr>, Option<LocatedExpr>)
RepeatUntil(LocatedExpr, LocatedListing)
Return(LocatedExpr)
Rorg(LocatedExpr, LocatedListing)
Run(LocatedExpr, Option<LocatedExpr>)
Save
Fields
§
filename: UnescapedString
§
address: Option<LocatedExpr>
§
size: Option<LocatedExpr>
§
dsk_filename: Option<UnescapedString>
§
side: Option<LocatedExpr>
Section(Z80Span)
SetN
Skip(LocatedExpr)
SnaInit(UnescapedString)
SnaSet(SnapshotFlag, FlagValue)
StableTicker(StableTickerAction<Z80Span>)
StartingIndex
Str(Vec<LocatedExpr>)
Struct(Z80Span, Vec<(Z80Span, LocatedToken)>)
Switch(LocatedExpr, Vec<(LocatedExpr, LocatedListing, bool)>, Option<LocatedListing>)
Undef(Z80Span)
WaitNops(LocatedExpr)
WarningWrapper(Box<Self>, String)
While(LocatedExpr, LocatedListing)
Implementations§
source§impl LocatedTokenInner
impl LocatedTokenInner
pub fn new_opcode( mne: Mnemonic, arg1: Option<LocatedDataAccess>, arg2: Option<LocatedDataAccess>, ) -> Self
pub fn into_located_token_direct(self) -> LocatedToken
pub fn into_located_token_at(self, span: InnerZ80Span) -> LocatedToken
sourcepub fn into_located_token_between(
self,
start_checkpoint: &<InnerZ80Span as Stream>::Checkpoint,
i: InnerZ80Span,
) -> LocatedToken
pub fn into_located_token_between( self, start_checkpoint: &<InnerZ80Span as Stream>::Checkpoint, i: InnerZ80Span, ) -> LocatedToken
start: checkpoint for the start of the token stop: checkpoint for the stop of the token i: stream after parse: is copied
Trait Implementations§
source§impl Debug for LocatedTokenInner
impl Debug for LocatedTokenInner
source§impl ListingElement for LocatedTokenInner
impl ListingElement for LocatedTokenInner
source§fn to_token(&self) -> Cow<'_, Token>
fn to_token(&self) -> Cow<'_, Token>
Transform the located token in a raw token. Warning, this is quite costly when strings or vec are involved
type AssemblerControlCommand = LocatedAssemblerControlCommand
type DataAccess = LocatedDataAccess
type Expr = LocatedExpr
type MacroParam = LocatedMacroParam
type TestKind = LocatedTestKind
fn is_buildcpr(&self) -> bool
fn is_equ(&self) -> bool
fn is_assign(&self) -> bool
fn equ_symbol(&self) -> &str
fn equ_value(&self) -> &Self::Expr
fn is_warning(&self) -> bool
fn warning_token(&self) -> &Self
fn warning_message(&self) -> &str
fn is_module(&self) -> bool
fn module_listing(&self) -> &[Self]
fn module_name(&self) -> &str
fn is_while(&self) -> bool
fn while_expr(&self) -> &Self::Expr
fn while_listing(&self) -> &[Self]
fn mnemonic(&self) -> Option<&Mnemonic>
fn mnemonic_arg1(&self) -> Option<&Self::DataAccess>
fn mnemonic_arg2(&self) -> Option<&Self::DataAccess>
fn mnemonic_arg1_mut(&mut self) -> Option<&mut Self::DataAccess>
fn mnemonic_arg2_mut(&mut self) -> Option<&mut Self::DataAccess>
fn is_directive(&self) -> bool
fn is_rorg(&self) -> bool
fn rorg_listing(&self) -> &[Self]
fn rorg_expr(&self) -> &Self::Expr
fn is_iterate(&self) -> bool
fn iterate_listing(&self) -> &[Self]
fn iterate_counter_name(&self) -> &str
fn iterate_values(&self) -> Either<&Vec<Self::Expr>, &Self::Expr> ⓘ
fn is_for(&self) -> bool
fn for_listing(&self) -> &[Self]
fn for_label(&self) -> &str
fn for_start(&self) -> &Self::Expr
fn for_stop(&self) -> &Self::Expr
fn for_step(&self) -> Option<&Self::Expr>
fn is_repeat_until(&self) -> bool
fn repeat_until_listing(&self) -> &[Self]
fn repeat_until_condition(&self) -> &Self::Expr
fn is_repeat(&self) -> bool
fn repeat_listing(&self) -> &[Self]
fn repeat_count(&self) -> &Self::Expr
fn repeat_counter_name(&self) -> Option<&str>
fn repeat_counter_start(&self) -> Option<&Self::Expr>
fn is_macro_definition(&self) -> bool
fn macro_definition_name(&self) -> &str
fn macro_definition_arguments(&self) -> SmallVec<[&str; 4]>
fn macro_definition_code(&self) -> &str
fn macro_call_name(&self) -> &str
fn macro_call_arguments(&self) -> &[Self::MacroParam]
fn is_if(&self) -> bool
fn if_nb_tests(&self) -> usize
fn if_test(&self, _idx: usize) -> (&Self::TestKind, &[Self])
fn if_else(&self) -> Option<&[Self]>
fn is_include(&self) -> bool
fn is_incbin(&self) -> bool
fn incbin_fname(&self) -> &str
fn incbin_offset(&self) -> Option<&Self::Expr>
fn incbin_length(&self) -> Option<&Self::Expr>
fn incbin_transformation(&self) -> &BinaryTransformation
fn include_fname(&self) -> &str
fn include_namespace(&self) -> Option<&str>
fn include_once(&self) -> bool
fn is_call_macro_or_build_struct(&self) -> bool
fn is_function_definition(&self) -> bool
fn function_definition_name(&self) -> &str
fn function_definition_params(&self) -> SmallVec<[&str; 4]>
fn function_definition_inner(&self) -> &[Self]
fn is_crunched_section(&self) -> bool
fn crunched_section_listing(&self) -> &[Self]
fn crunched_section_kind(&self) -> &CrunchType
fn is_confined(&self) -> bool
fn confined_listing(&self) -> &[Self]
fn is_switch(&self) -> bool
fn switch_expr(&self) -> &Self::Expr
fn switch_cases( &self, ) -> Box<dyn Iterator<Item = (&Self::Expr, &[Self], bool)> + '_>
fn switch_default(&self) -> Option<&[Self]>
fn is_db(&self) -> bool
fn is_dw(&self) -> bool
fn is_str(&self) -> bool
fn data_exprs(&self) -> &[Self::Expr]
fn is_set(&self) -> bool
fn is_comment(&self) -> bool
fn is_org(&self) -> bool
fn repeat_counter_step(&self) -> Option<&Self::Expr>
fn is_assembler_control(&self) -> bool
fn assembler_control_command(&self) -> &Self::AssemblerControlCommand
fn defer_listing_output(&self) -> bool
fn include_is_standard_include(&self) -> bool
fn assembler_control_get_max_passes(&self) -> Option<&Self::Expr>
fn assembler_control_get_listing(&self) -> &[Self]
fn macro_flavor(&self) -> AssemblerFlavor
source§impl ParsingStateVerified for LocatedTokenInner
impl ParsingStateVerified for LocatedTokenInner
fn is_accepted(&self, state: &ParsingState) -> bool
source§impl PartialEq for LocatedTokenInner
impl PartialEq for LocatedTokenInner
impl Eq for LocatedTokenInner
impl StructuralPartialEq for LocatedTokenInner
Auto Trait Implementations§
impl !Freeze for LocatedTokenInner
impl RefUnwindSafe for LocatedTokenInner
impl Send for LocatedTokenInner
impl Sync for LocatedTokenInner
impl Unpin for LocatedTokenInner
impl UnwindSafe for LocatedTokenInner
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> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.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 moresource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.