(
&mut self,
mut pending_literal: Option<Wtf8Buf>,
mut element_count: u32,
)
| 10005 | } |
| 10006 | |
| 10007 | fn finish_fstring( |
| 10008 | &mut self, |
| 10009 | mut pending_literal: Option<Wtf8Buf>, |
| 10010 | mut element_count: u32, |
| 10011 | ) -> CompileResult<()> { |
| 10012 | let keep_empty = element_count == 0; |
| 10013 | self.emit_pending_fstring_literal(&mut pending_literal, &mut element_count, keep_empty); |
| 10014 | |
| 10015 | if element_count == 0 { |
| 10016 | self.emit_load_const(ConstantData::Str { |
| 10017 | value: Wtf8Buf::new(), |
| 10018 | }); |
| 10019 | } else if element_count > 1 { |
| 10020 | emit!( |
| 10021 | self, |
| 10022 | Instruction::BuildString { |
| 10023 | count: element_count |
| 10024 | } |
| 10025 | ); |
| 10026 | } |
| 10027 | |
| 10028 | Ok(()) |
| 10029 | } |
| 10030 | |
| 10031 | fn emit_pending_fstring_literal( |
| 10032 | &mut self, |
no test coverage detected