GeezerVison is showing docs.rs — Tok in rustpython_parser - Rust pub enum Tok {
Show 97 variants Name {
name: String,
},
Int {
value: BigInt,
},
Float {
value: f64,
},
Complex {
real: f64,
imag: f64,
},
String {
value: String,
kind: StringKind,
triple_quoted: bool,
},
Newline,
Indent,
Dedent,
EndOfFile,
Lpar,
Rpar,
Lsqb,
Rsqb,
Colon,
Comma,
Semi,
Plus,
Minus,
Star,
Slash,
Vbar,
Amper,
Less,
Greater,
Equal,
Dot,
Percent,
Lbrace,
Rbrace,
EqEqual,
NotEqual,
LessEqual,
GreaterEqual,
Tilde,
CircumFlex,
LeftShift,
RightShift,
DoubleStar,
DoubleStarEqual,
PlusEqual,
MinusEqual,
StarEqual,
SlashEqual,
PercentEqual,
AmperEqual,
VbarEqual,
CircumflexEqual,
LeftShiftEqual,
RightShiftEqual,
DoubleSlash,
DoubleSlashEqual,
ColonEqual,
At,
AtEqual,
Rarrow,
Ellipsis,
False,
None,
True,
And,
As,
Assert,
Async,
Await,
Break,
Class,
Continue,
Def,
Del,
Elif,
Else,
Except,
Finally,
For,
From,
Global,
If,
Import,
In,
Is,
Lambda,
Nonlocal,
Not,
Or,
Pass,
Raise,
Return,
Try,
While,
Match,
Type,
Case,
With,
Yield,
StartModule,
StartInteractive,
StartExpression,
}
Expand descriptionThe set of tokens the Python source code can be tokenized in.
Variants§Token value for a name, commonly known as an identifier.
Token value for an integer.
Token value for a floating point number.
Token value for a complex number.
Fields§real: f64The real part of the complex number.
§imag: f64The imaginary part of the complex number.
Token value for a string.
Fields§triple_quoted: boolWhether the string is triple quoted.
Token value for a newline.
Token value for an indent.
Token value for a dedent.
Token value for a left parenthesis (.
Token value for a right parenthesis ).
Token value for a left square bracket [.
Token value for a right square bracket ].
Token value for a colon :.
Token value for a comma ,.
Token value for a semicolon ;.
Token value for vertical bar |.
Token value for ampersand &.
Token value for less than <.
Token value for greater than >.
Token value for percent %.
Token value for left bracket {.
Token value for right bracket }.
Token value for double equal ==.
Token value for not equal !=.
Token value for less than or equal <=.
Token value for greater than or equal >=.
Token value for left shift <<.
Token value for right shift >>.
Token value for double star **.
Token value for double star equal **=.
Token value for plus equal +=.
Token value for minus equal -=.
Token value for star equal *=.
Token value for slash equal /=.
Token value for percent equal %=.
Token value for ampersand equal &=.
Token value for vertical bar equal |=.
Token value for caret equal ^=.
Token value for left shift equal <<=.
Token value for right shift equal >>=.
Token value for double slash //.
Token value for double slash equal //=.
Token value for colon equal :=.
Token value for at equal @=.
Token value for arrow ->.
Token value for ellipsis ....
Implementations§
Returns true if self is of variant Name.
Returns true if self is of variant Int.
Returns true if self is of variant Float.
Returns true if self is of variant Complex.
Returns true if self is of variant String.
Returns true if self is of variant Newline.
Returns true if self is of variant Indent.
Returns true if self is of variant Dedent.
Returns true if self is of variant EndOfFile.
Returns true if self is of variant Lpar.
Returns true if self is of variant Rpar.
Returns true if self is of variant Lsqb.
Returns true if self is of variant Rsqb.
Returns true if self is of variant Colon.
Returns true if self is of variant Comma.
Returns true if self is of variant Semi.
Returns true if self is of variant Plus.
Returns true if self is of variant Minus.
Returns true if self is of variant Star.
Returns true if self is of variant Slash.
Returns true if self is of variant Vbar.
Returns true if self is of variant Amper.
Returns true if self is of variant Less.
Returns true if self is of variant Greater.
Returns true if self is of variant Equal.
Returns true if self is of variant Dot.
Returns true if self is of variant Percent.
Returns true if self is of variant Lbrace.
Returns true if self is of variant Rbrace.
Returns true if self is of variant EqEqual.
Returns true if self is of variant NotEqual.
Returns true if self is of variant LessEqual.
Returns true if self is of variant Tilde.
Returns true if self is of variant LeftShift.
Returns true if self is of variant PlusEqual.
Returns true if self is of variant StarEqual.
Returns true if self is of variant VbarEqual.
Returns true if self is of variant At.
Returns true if self is of variant AtEqual.
Returns true if self is of variant Rarrow.
Returns true if self is of variant Ellipsis.
Returns true if self is of variant False.
Returns true if self is of variant None.
Returns true if self is of variant True.
Returns true if self is of variant And.
Returns true if self is of variant As.
Returns true if self is of variant Assert.
Returns true if self is of variant Async.
Returns true if self is of variant Await.
Returns true if self is of variant Break.
Returns true if self is of variant Class.
Returns true if self is of variant Continue.
Returns true if self is of variant Def.
Returns true if self is of variant Del.
Returns true if self is of variant Elif.
Returns true if self is of variant Else.
Returns true if self is of variant Except.
Returns true if self is of variant Finally.
Returns true if self is of variant For.
Returns true if self is of variant From.
Returns true if self is of variant Global.
Returns true if self is of variant If.
Returns true if self is of variant Import.
Returns true if self is of variant In.
Returns true if self is of variant Is.
Returns true if self is of variant Lambda.
Returns true if self is of variant Nonlocal.
Returns true if self is of variant Not.
Returns true if self is of variant Or.
Returns true if self is of variant Pass.
Returns true if self is of variant Raise.
Returns true if self is of variant Return.
Returns true if self is of variant Try.
Returns true if self is of variant While.
Returns true if self is of variant Match.
Returns true if self is of variant Type.
Returns true if self is of variant Case.
Returns true if self is of variant With.
Returns true if self is of variant Yield.
Trait Implementations§
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
Auto Trait Implementations§Blanket Implementations§
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬This is a nightly-only experimental API. (clone_to_uninit) Performs copy-assignment from self to dest. 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.
Returns the String produced by Ts Debug implementation.
§Examples
use malachite_base::strings::ToDebugString;
assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
[vec![2, 3], vec![], vec![4]].to_debug_string(),
"[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. 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.
|