Remove Enum Instruction::Unpack

This commit is contained in:
j30ng committed 2019-09-12 16:30:03 +09:00
1 parent 95d57ef9c4
commit a5bea47bed
3 files changed
+1 -14

No files matched your search

-2
View File
@@ -258,7 +258,6 @@ pub enum Instruction {
before: usize,
after: usize,
},
Unpack,
FormatValue {
conversion: Option<ConversionFlag>,
spec: String,
@@ -522,7 +521,6 @@ impl Instruction {
LoadBuildClass => w!(LoadBuildClass),
UnpackSequence { size } => w!(UnpackSequence, size),
UnpackEx { before, after } => w!(UnpackEx, before, after),
Unpack => w!(Unpack),
FormatValue { spec, .. } => w!(FormatValue, spec), // TODO: write conversion
PopException => w!(PopException),
Reverse { amount } => w!(Reverse, amount),
+1 -2
View File
@@ -1617,9 +1617,8 @@ impl<O: OutputStream> Compiler<O> {
self.compile_comprehension(kind, generators)?;
}
Starred { .. } => {
use std::string::String;
return Err(CompileError {
error: CompileErrorType::SyntaxError(String::from(
error: CompileErrorType::SyntaxError(std::string::String::from(
"Invalid starred expression",
)),
location: self.current_source_location.clone(),
-10
View File
@@ -478,7 +478,6 @@ impl Frame {
bytecode::Instruction::UnpackEx { before, after } => {
self.execute_unpack_ex(vm, *before, *after)
}
bytecode::Instruction::Unpack => self.execute_unpack(vm),
bytecode::Instruction::FormatValue { conversion, spec } => {
use bytecode::ConversionFlag::*;
let value = match conversion {
@@ -979,15 +978,6 @@ impl Frame {
}
}
fn execute_unpack(&self, vm: &VirtualMachine) -> FrameResult {
let value = self.pop_value();
let elements = vm.extract_elements(&value)?;
for element in elements.into_iter().rev() {
self.push_value(element);
}
Ok(None)
}
fn jump(&self, label: bytecode::Label) {
let target_pc = self.code.label_map[&label];
#[cfg(feature = "vm-tracing-logging")]