From: Mark Thom Date: Wed, 2 Jul 2025 01:40:49 +0000 (-0700) Subject: be more careful about concatenating '.' in parse_number_from_string (#2986) X-Git-Tag: v0.10.0~42 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=8e01eea440d72142ec2a03325a6ff371b479a440;p=scryer-prolog.git be more careful about concatenating '.' in parse_number_from_string (#2986) --- diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index dc5da32a..9d056ff9 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -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); }