]> Repositorios git - scryer-prolog.git/commitdiff
be more careful about concatenating '.' in parse_number_from_string (#2986)
authorMark Thom <[email protected]>
Wed, 2 Jul 2025 01:40:49 +0000 (18:40 -0700)
committerMark Thom <[email protected]>
Wed, 2 Jul 2025 01:40:49 +0000 (18:40 -0700)
src/machine/system_calls.rs

index dc5da32a67eb41f04dfc1862fe1c6541c4c58947..9d056ff9c0ee2760353246298cdb17667c81aea0 100644 (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);
             }