From de7f9efd5403d42139c143fd6664f3b2c313b4c7 Mon Sep 17 00:00:00 2001 From: Aviv Palivoda Date: Fri, 13 Dec 2019 11:33:19 +0200 Subject: [PATCH] Support expression in f-strings spec --- src/compile.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/compile.rs b/src/compile.rs index 24df923..d02d3d3 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -2108,10 +2108,17 @@ impl Compiler { 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(), }); } }