mirror of
https://github.com/RustPython/Parser.git
synced 2025-09-01 08:07:50 +00:00
Support expression in f-strings spec
This commit is contained in:
parent
8adb8b5105
commit
de7f9efd54
1 changed files with 8 additions and 1 deletions
|
@ -2108,10 +2108,17 @@ impl<O: OutputStream> Compiler<O> {
|
|||
conversion,
|
||||
spec,
|
||||
} => {
|
||||
match spec {
|
||||
Some(spec) => self.compile_string(spec)?,
|
||||
None => self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::String {
|
||||
value: String::new(),
|
||||
},
|
||||
}),
|
||||
};
|
||||
self.compile_expression(value)?;
|
||||
self.emit(Instruction::FormatValue {
|
||||
conversion: conversion.map(compile_conversion_flag),
|
||||
spec: spec.clone(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue