Enum erg_parser::token::TokenKind
source · #[repr(u8)]
pub enum TokenKind {
Show 83 variants
Symbol,
NatLit,
IntLit,
RatioLit,
BoolLit,
StrLit,
StrInterpLeft,
StrInterpMid,
StrInterpRight,
NoneLit,
NoImplLit,
EllipsisLit,
InfLit,
DocComment,
PrePlus,
PreMinus,
PreBitNot,
Mutate,
Try,
Plus,
Minus,
Star,
Slash,
FloorDiv,
Pow,
Mod,
Closed,
RightOpen,
LeftOpen,
Open,
BitAnd,
BitOr,
BitXor,
Shl,
Shr,
Less,
Gre,
LessEq,
GreEq,
DblEq,
NotEq,
InOp,
NotInOp,
SubOp,
IsOp,
IsNotOp,
AndOp,
OrOp,
DotOp,
CrossOp,
RefOp,
RefMutOp,
Equal,
Inclusion,
Walrus,
FuncArrow,
ProcArrow,
LParen,
RParen,
LSqBr,
RSqBr,
LBrace,
RBrace,
Indent,
Dedent,
Dot,
Pipe,
Colon,
DblColon,
SupertypeOf,
SubtypeOf,
Comma,
Caret,
Amper,
AtSign,
VBar,
UBar,
Spread,
Newline,
Semi,
Illegal,
BOF,
EOF,
}
Expand description
意味論的名前と記号自体の名前が混在しているが、Pythonの名残である
Variants§
Symbol
e.g. i, p!, $s, T, +
, and
, ‘d/dx’
NatLit
e.g. 0, 1
IntLit
e.g. -1, -2
RatioLit
BoolLit
StrLit
StrInterpLeft
e.g. “abc{
StrInterpMid
e.g. }abc{
StrInterpRight
e.g. }def“
NoneLit
NoImplLit
EllipsisLit
InfLit
DocComment
PrePlus
+
(unary)
PreMinus
-
(unary)
PreBitNot
~ (unary)
Mutate
! (unary)
Try
? (postfix)
Plus
+
Minus
-
Star
*
Slash
/
FloorDiv
//
Pow
**
Mod
%
Closed
..
RightOpen
..<
LeftOpen
<..
Open
<..<
BitAnd
&&
BitOr
||
BitXor
^^
Shl
<<
Shr
Less
<
Gre
LessEq
<=
GreEq
=
DblEq
==
NotEq
!=
InOp
in
NotInOp
notin
SubOp
sub
(subtype of)
IsOp
is!
IsNotOp
isnot!
AndOp
and
OrOp
or
DotOp
dot
(scalar product)
CrossOp
cross
(vector product)
RefOp
ref
(special unary)
RefMutOp
ref!
(special unary)
Equal
=
Inclusion
<-
Walrus
:=
FuncArrow
->
ProcArrow
=>
LParen
(
RParen
)
LSqBr
[
RSqBr
]
LBrace
{
RBrace
}
Indent
Dedent
Dot
.
Pipe
|>
Colon
:
DblColon
::
SupertypeOf
:>
SubtypeOf
<:
Comma
,
Caret
^
Amper
&
AtSign
@
VBar
|
UBar
_
Spread
…
Newline
\n
Semi
;
Illegal
BOF
Beginning Of File