pub enum LocatedToken {
Show 21 variants Standard { token: Token, span: Z80Span, }, Defb(Vec<LocatedExpr>, Z80Span), Defw(Vec<LocatedExpr>, Z80Span), CrunchedSection(CrunchTypeLocatedListingZ80Span), Str(Vec<LocatedExpr>, Z80Span), For { label: Z80Span, start: LocatedExpr, stop: LocatedExpr, step: Option<LocatedExpr>, listing: LocatedListing, span: Z80Span, }, Function(Z80SpanVec<Z80Span>, LocatedListingZ80Span), Include(Z80SpanOption<Z80Span>, boolZ80Span), Incbin { fname: Z80Span, offset: Option<LocatedExpr>, length: Option<LocatedExpr>, extended_offset: Option<LocatedExpr>, off: bool, transformation: BinaryTransformation, span: Z80Span, }, If(Vec<(LocatedTestKind, LocatedListing)>, Option<LocatedListing>, Z80Span), Label(Z80Span), Macro { name: Z80Span, params: Vec<Z80Span>, content: Z80Span, span: Z80Span, }, MacroCall(Z80SpanVec<LocatedMacroParam>, Z80Span), Repeat(LocatedExprLocatedListingOption<Z80Span>, Option<LocatedExpr>, Z80Span), Iterate(Z80SpanEither<Vec<LocatedExpr>, LocatedExpr>, LocatedListingZ80Span), RepeatUntil(LocatedExprLocatedListingZ80Span), Rorg(LocatedExprLocatedListingZ80Span), Struct(Z80SpanVec<(Z80Span, LocatedToken)>, Z80Span), Switch(LocatedExprVec<(LocatedExpr, LocatedListing, bool)>, Option<LocatedListing>, Z80Span), While(LocatedExprLocatedListingZ80Span), Module(Z80SpanLocatedListingZ80Span),
}
Expand description

Add span information for a Token. This hierarchy is a mirror of the original token one

Variants

Standard

Fields

token: Token

The original token without any span information

span: Z80Span

The span that correspond to the token

A token without any listing embedding

Defb(Vec<LocatedExpr>, Z80Span)

Defw(Vec<LocatedExpr>, Z80Span)

CrunchedSection(CrunchTypeLocatedListingZ80Span)

Str(Vec<LocatedExpr>, Z80Span)

For

Fields

label: Z80Span
start: LocatedExpr
listing: LocatedListing
span: Z80Span

Function(Z80SpanVec<Z80Span>, LocatedListingZ80Span)

Include(Z80SpanOption<Z80Span>, boolZ80Span)

Incbin

Fields

fname: Z80Span
extended_offset: Option<LocatedExpr>
off: bool
transformation: BinaryTransformation
span: Z80Span

If(Vec<(LocatedTestKind, LocatedListing)>, Option<LocatedListing>, Z80Span)

Label(Z80Span)

Macro

Fields

name: Z80Span
params: Vec<Z80Span>
content: Z80Span
span: Z80Span

MacroCall(Z80SpanVec<LocatedMacroParam>, Z80Span)

Name, Parameters, FullSpan

Repeat(LocatedExprLocatedListingOption<Z80Span>, Option<LocatedExpr>, Z80Span)

Iterate(Z80SpanEither<Vec<LocatedExpr>, LocatedExpr>, LocatedListingZ80Span)

RepeatUntil(LocatedExprLocatedListingZ80Span)

Rorg(LocatedExprLocatedListingZ80Span)

Struct(Z80SpanVec<(Z80Span, LocatedToken)>, Z80Span)

Name, Parameters, FullSpan

Switch(LocatedExprVec<(LocatedExpr, LocatedListing, bool)>, Option<LocatedListing>, Z80Span)

While(LocatedExprLocatedListingZ80Span)

Module(Z80SpanLocatedListingZ80Span)

Implementations

We can obtain a token only for “standard ones”. Those that rely on listing need to be handled differently

Transform the located token in a raw token. Warning, this is quite costly when strings or vec are involved

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Get the span of the current token

Convert the token in its simplest form

Unroll the tokens when it represents a loop

Generate the listing of opcodes for directives that embed bytes

Return the number of bytes of the token given the provided context

Dummy version that assemble without taking into account the context TODO find a way to not build a symbol table each time Read more

Assemble the symbol taking into account some context, but never modify this context

Check if the token is valid. We consider a token vlaid if it is possible to assemble it

Make all the necessary for the given token

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted. Read more

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted. Read more

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.