[][src]Enum rustpython_parser::token::Tok

pub enum Tok {
    Name {
        name: String,
    },
    Int {
        value: BigInt,
    },
    Float {
        value: f64,
    },
    Complex {
        real: f64,
        imag: f64,
    },
    String {
        value: String,
        is_fstring: bool,
    },
    Bytes {
        value: Vec<u8>,
    },
    Newline,
    Indent,
    Dedent,
    StartProgram,
    StartStatement,
    StartExpression,
    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,
    With,
    Yield,
}

Python source code can be tokenized in a sequence of these tokens.

Variants

Name

Fields of Name

name: String
Int

Fields of Int

value: BigInt
Float

Fields of Float

value: f64
Complex

Fields of Complex

real: f64imag: f64
String

Fields of String

value: Stringis_fstring: bool
Bytes

Fields of Bytes

value: Vec<u8>
Newline
Indent
Dedent
StartProgram
StartStatement
StartExpression
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
With
Yield

Trait Implementations

impl Clone for Tok[src]

impl Debug for Tok[src]

impl Display for Tok[src]

impl PartialEq<Tok> for Tok[src]

impl StructuralPartialEq for Tok[src]

Auto Trait Implementations

impl RefUnwindSafe for Tok

impl Send for Tok

impl Sync for Tok

impl Unpin for Tok

impl UnwindSafe for Tok

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.