[][src]Enum rustpython_parser::ast::Expression

pub enum Expression {
    BoolOp {
        a: Box<Expression>,
        op: BooleanOperator,
        b: Box<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: Parameters,
        body: Box<Expression>,
    },
    IfExpression {
        test: Box<Expression>,
        body: Box<Expression>,
        orelse: Box<Expression>,
    },
    True,
    False,
    None,
    Ellipsis,
}

Variants

BoolOp

Fields of BoolOp

a: Box<Expression>op: BooleanOperatorb: Box<Expression>
Binop

Fields of Binop

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

Fields of Subscript

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

Fields of Unop

op: UnaryOperatora: Box<Expression>
Await

Fields of Await

value: Box<Expression>
Yield

Fields of Yield

value: Option<Box<Expression>>
YieldFrom

Fields of YieldFrom

value: Box<Expression>
Compare

Fields of Compare

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

Fields of Attribute

value: Box<Expression>name: String
Call

Fields of Call

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

Fields of Number

value: Number
List

Fields of List

elements: Vec<Expression>
Tuple

Fields of Tuple

elements: Vec<Expression>
Dict

Fields of Dict

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

Fields of Set

elements: Vec<Expression>
Comprehension

Fields of Comprehension

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

Fields of Starred

value: Box<Expression>
Slice

Fields of Slice

elements: Vec<Expression>
String

Fields of String

value: StringGroup
Bytes

Fields of Bytes

value: Vec<u8>
Identifier

Fields of Identifier

name: String
Lambda

Fields of Lambda

args: Parametersbody: Box<Expression>
IfExpression

Fields of IfExpression

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

Methods

impl Expression[src]

pub fn name(&self) -> &'static str[src]

Returns a short name for the node suitable for use in error messages.

Trait Implementations

impl PartialEq<Expression> for Expression[src]

impl Debug for Expression[src]

Auto Trait Implementations

Blanket Implementations

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.

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

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

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