[][src]Enum rustpython_parser::ast::ExpressionType

pub enum ExpressionType {
    BoolOp {
        op: BooleanOperator,
        values: Vec<Expression>,
    },
    Binop {
        a: Box<Expression>,
        op: Operator,
        b: Box<Expression>,
    },
    Subscript {
        a: Box<Expression>,
        b: Box<Expression>,
    },
    Unop {
        op: UnaryOperator,
        a: Box<Expression>,
    },
    Await {
        value: Box<Expression>,
    },
    Yield {
        value: Option<Box<Expression>>,
    },
    YieldFrom {
        value: Box<Expression>,
    },
    Compare {
        vals: Vec<Expression>,
        ops: Vec<Comparison>,
    },
    Attribute {
        value: Box<Expression>,
        name: String,
    },
    Call {
        function: Box<Expression>,
        args: Vec<Expression>,
        keywords: Vec<Keyword>,
    },
    Number {
        value: Number,
    },
    List {
        elements: Vec<Expression>,
    },
    Tuple {
        elements: Vec<Expression>,
    },
    Dict {
        elements: Vec<(Option<Expression>, Expression)>,
    },
    Set {
        elements: Vec<Expression>,
    },
    Comprehension {
        kind: Box<ComprehensionKind>,
        generators: Vec<Comprehension>,
    },
    Starred {
        value: Box<Expression>,
    },
    Slice {
        elements: Vec<Expression>,
    },
    String {
        value: StringGroup,
    },
    Bytes {
        value: Vec<u8>,
    },
    Identifier {
        name: String,
    },
    Lambda {
        args: Box<Parameters>,
        body: Box<Expression>,
    },
    IfExpression {
        test: Box<Expression>,
        body: Box<Expression>,
        orelse: Box<Expression>,
    },
    NamedExpression {
        left: Box<Expression>,
        right: Box<Expression>,
    },
    True,
    False,
    None,
    Ellipsis,
}

A certain type of expression.

Variants

BoolOp

Fields of BoolOp

op: BooleanOperatorvalues: Vec<Expression>
Binop

A binary operation on two operands.

Fields of Binop

a: Box<Expression>op: Operatorb: Box<Expression>
Subscript

Subscript operation.

Fields of Subscript

a: Box<Expression>b: Box<Expression>
Unop

An unary operation.

Fields of Unop

op: UnaryOperatora: Box<Expression>
Await

An await expression.

Fields of Await

value: Box<Expression>
Yield

A yield expression.

Fields of Yield

value: Option<Box<Expression>>
YieldFrom

Fields of YieldFrom

value: Box<Expression>
Compare

A chained comparison. Note that in python you can use 1 < a < 10 for example.

Fields of Compare

vals: Vec<Expression>ops: Vec<Comparison>
Attribute

Attribute access in the form of value.name.

Fields of Attribute

value: Box<Expression>name: String
Call

A call expression.

Fields of Call

function: Box<Expression>args: Vec<Expression>keywords: Vec<Keyword>
Number

A numeric literal.

Fields of Number

value: Number
List

A list literal value.

Fields of List

elements: Vec<Expression>
Tuple

A tuple literal value.

Fields of Tuple

elements: Vec<Expression>
Dict

A dict literal value. For example: {2: 'two', 3: 'three'}

Fields of Dict

elements: Vec<(Option<Expression>, Expression)>
Set

A set literal.

Fields of Set

elements: Vec<Expression>
Comprehension

Fields of Comprehension

kind: Box<ComprehensionKind>generators: Vec<Comprehension>
Starred

A starred expression.

Fields of Starred

value: Box<Expression>
Slice

A slice expression.

Fields of Slice

elements: Vec<Expression>
String

A string literal.

Fields of String

value: StringGroup
Bytes

A bytes literal.

Fields of Bytes

value: Vec<u8>
Identifier

An identifier, designating a certain variable or type.

Fields of Identifier

name: String
Lambda

A lambda function expression.

Fields of Lambda

args: Box<Parameters>body: Box<Expression>
IfExpression

An if-expression.

Fields of IfExpression

test: Box<Expression>body: Box<Expression>orelse: Box<Expression>
NamedExpression

Fields of NamedExpression

left: Box<Expression>right: Box<Expression>
True

The literal 'True'.

False

The literal 'False'.

None
Ellipsis

The ellipsis literal ....

Trait Implementations

impl Debug for ExpressionType[src]

impl PartialEq<ExpressionType> for ExpressionType[src]

impl StructuralPartialEq for ExpressionType[src]

Auto Trait Implementations

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, 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.