pub(crate) enum Token {
Show 36 variants
Error(ErrorTokenKind),
LeftBrace(Script),
RightBrace(Script),
Newline,
Tab,
LeftParen(Script),
RightParen(Script),
Hold,
NotHold,
Arrow(Script),
Hand(Script),
Hash(Script),
Equals(Script),
Asterisk(Script),
Pipe(Script),
DoublePipe(Script),
ProperSuperset(Script),
SubsetOf(Script),
IdenticalTo(Script),
Tilde(Script),
LessThan(Script),
GreaterThan(Script),
Query(Script),
Intersection(Script),
Union(Script),
Solidus(Script),
Plus(Script),
Minus(Script),
Times(Script),
LogicalOr(Script),
LogicalAnd(Script),
Digits(Script, NumericLiteral),
BitPosition(Script, String, String),
SymexSyllable(Script, String),
Dot(Script),
Comma(Script),
}
Expand description
The parser consumes these tokens.
Variants§
Error(ErrorTokenKind)
LeftBrace(Script)
RightBrace(Script)
Newline
Tab
LeftParen(Script)
The parser currently only handled parenthesised expressions in normal script.
RightParen(Script)
The parser currently only handled parenthesised expressions in normal script.
Hold
Accept either ‘h’ or ‘:’ signalling the hold bit (of the instruction word) should be set. The documentation seems to use both, though perhaps ‘:’ is the older usage.
While h is indeed a letter, it is not one of the letters which can form part of a symex. See the TX-2 Users Handbook, section 6-3.2, “RULES FOR SYMEX FORMATION”.
NotHold
Arrow(Script)
Hand(Script)
Hash(Script)
Equals(Script)
Asterisk(Script)
Asterisk is used quite heavily (indicating deferred addressing) but while the TX-2 supports superscript and subscript asterisks, they don’t seem to be used. They are not valid as part of a symex (see User handbook, section 6-2.3) and are not macro terminators (6-4.5). However, they are valid as part of a superposed character sequence making up a compound-character macro name.
Pipe(Script)
DoublePipe(Script)
ProperSuperset(Script)
SubsetOf(Script)
IdenticalTo(Script)
Tilde(Script)
LessThan(Script)
GreaterThan(Script)
Query(Script)
Intersection(Script)
Union(Script)
Solidus(Script)
Solidus is often called “slash” but people often confuse slash and backslash. So we don’t call it either.
Plus(Script)
Minus(Script)
Times(Script)
LogicalOr(Script)
LogicalAnd(Script)
Digits(Script, NumericLiteral)
BitPosition(Script, String, String)
SymexSyllable(Script, String)
The rules concerning which characters can be part of a symex are given in the TX-2 Users Handbook, section 6-3.2, “RULES FOR SYMEX FORMATION”.
We so not accept dot as part of this token becuase it behaves differently in some circumstances (it is a macro terminator). However it is part of a valid symex also, and so we will need to parse it as such.
Dot(Script)
Comma(Script)
Trait Implementations§
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef
].