mirror of
https://github.com/RustPython/Parser.git
synced 2025-09-04 01:21:27 +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,
|
conversion,
|
||||||
spec,
|
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.compile_expression(value)?;
|
||||||
self.emit(Instruction::FormatValue {
|
self.emit(Instruction::FormatValue {
|
||||||
conversion: conversion.map(compile_conversion_flag),
|
conversion: conversion.map(compile_conversion_flag),
|
||||||
spec: spec.clone(),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue