be more careful about concatenating '.' in parse_number_from_string (#2986)

This commit is contained in:
Mark Thom
2025-07-01 18:40:49 -07:00
parent 1cf5de8f5c
commit 8e01eea440

View File

@@ -911,13 +911,13 @@ impl MachineState {
use crate::parser::lexer::*;
let nx = self.store(self.deref(self.registers[2]));
let add_dot = !string.ends_with('.');
let add_dot = !string.ends_with('.') || string.ends_with("'.");
let cursor = std::io::Cursor::new(string);
let iter = std::io::Read::chain(cursor, {
let mut dot_buf: [u8; '.'.len_utf8()] = [0u8];
if add_dot {
if add_dot && !string.ends_with('\'') {
'.'.encode_utf8(&mut dot_buf);
}