pub enum Instruction {
Show 65 variants
Import {
name: Option<String>,
symbols: Vec<String>,
level: usize,
},
ImportStar,
ImportFrom {
name: String,
},
LoadName {
name: String,
scope: NameScope,
},
StoreName {
name: String,
scope: NameScope,
},
DeleteName {
name: String,
},
Subscript,
StoreSubscript,
DeleteSubscript,
StoreAttr {
name: String,
},
DeleteAttr {
name: String,
},
LoadConst {
value: Constant,
},
UnaryOperation {
op: UnaryOperator,
},
BinaryOperation {
op: BinaryOperator,
inplace: bool,
},
LoadAttr {
name: String,
},
CompareOperation {
op: ComparisonOperator,
},
Pop,
Rotate {
amount: usize,
},
Duplicate,
GetIter,
Continue,
Break,
Jump {
target: Label,
},
JumpIfTrue {
target: Label,
},
JumpIfFalse {
target: Label,
},
JumpIfTrueOrPop {
target: Label,
},
JumpIfFalseOrPop {
target: Label,
},
MakeFunction,
CallFunction {
typ: CallType,
},
ForIter {
target: Label,
},
ReturnValue,
YieldValue,
YieldFrom,
SetupLoop {
start: Label,
end: Label,
},
SetupFinally {
handler: Label,
},
EnterFinally,
EndFinally,
SetupExcept {
handler: Label,
},
SetupWith {
end: Label,
},
WithCleanupStart,
WithCleanupFinish,
PopBlock,
Raise {
argc: usize,
},
BuildString {
size: usize,
},
BuildTuple {
size: usize,
unpack: bool,
},
BuildList {
size: usize,
unpack: bool,
},
BuildSet {
size: usize,
unpack: bool,
},
BuildMap {
size: usize,
unpack: bool,
for_call: bool,
},
BuildSlice {
size: usize,
},
ListAppend {
i: usize,
},
SetAdd {
i: usize,
},
MapAdd {
i: usize,
},
PrintExpr,
LoadBuildClass,
UnpackSequence {
size: usize,
},
UnpackEx {
before: usize,
after: usize,
},
FormatValue {
conversion: Option<ConversionFlag>,
},
PopException,
Reverse {
amount: usize,
},
GetAwaitable,
BeforeAsyncWith,
SetupAsyncWith {
end: Label,
},
GetAIter,
GetANext,
MapAddRev {
i: usize,
},
}
Expand description
A Single bytecode instruction.
Variants§
Import
ImportStar
ImportFrom
LoadName
StoreName
DeleteName
Subscript
StoreSubscript
DeleteSubscript
StoreAttr
DeleteAttr
LoadConst
UnaryOperation
Fields
op: UnaryOperator
BinaryOperation
LoadAttr
CompareOperation
Fields
Pop
Rotate
Duplicate
GetIter
Continue
Break
Jump
JumpIfTrue
Pop the top of the stack, and jump if this value is true.
JumpIfFalse
Pop the top of the stack, and jump if this value is false.
JumpIfTrueOrPop
Peek at the top of the stack, and jump if this value is true. Otherwise, pop top of stack.
JumpIfFalseOrPop
Peek at the top of the stack, and jump if this value is false. Otherwise, pop top of stack.
MakeFunction
CallFunction
ForIter
ReturnValue
YieldValue
YieldFrom
SetupLoop
SetupFinally
Setup a finally handler, which will be called whenever one of this events occurs:
- the block is popped
- the function returns
- an exception is returned
EnterFinally
Enter a finally block, without returning, excepting, just because we are there.
EndFinally
Marker bytecode for the end of a finally sequence. When this bytecode is executed, the eval loop does one of those things:
- Continue at a certain bytecode position
- Propagate the exception
- Return from a function
- Do nothing at all, just continue
SetupExcept
SetupWith
WithCleanupStart
WithCleanupFinish
PopBlock
Raise
BuildString
BuildTuple
BuildList
BuildSet
BuildMap
BuildSlice
ListAppend
SetAdd
MapAdd
PrintExpr
LoadBuildClass
UnpackSequence
UnpackEx
FormatValue
Fields
conversion: Option<ConversionFlag>
PopException
Reverse
GetAwaitable
BeforeAsyncWith
SetupAsyncWith
GetAIter
GetANext
MapAddRev
Reverse order evaluation in MapAdd required to support named expressions of Python 3.8 in dict comprehension today (including Py3.9) only required in dict comprehension.
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Instruction
impl Debug for Instruction
Source§impl<'de> Deserialize<'de> for Instruction
impl<'de> Deserialize<'de> for Instruction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Instruction
impl PartialEq for Instruction
Source§impl Serialize for Instruction
impl Serialize for Instruction
impl StructuralPartialEq for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more