]> Repositorios git - scryer-prolog.git/commitdiff
Parse as much of a list as possible as a partial string #1404
authorbakaq <[email protected]>
Thu, 28 Dec 2023 17:58:23 +0000 (14:58 -0300)
committerbakaq <[email protected]>
Thu, 28 Dec 2023 18:12:32 +0000 (15:12 -0300)
src/parser/parser.rs

index de2b04a089a4d86067a475810009a6fa44c3beed..473cbe46a500f09c4ec2e00215db9e20ea1c0893 100644 (file)
@@ -97,7 +97,12 @@ pub(crate) fn as_partial_string(
                         string.push(*c);
                     }
                     _ => {
-                        return Err(Term::Cons(Cell::default(), Box::new(head), orig_tail));
+                        tail = Term::Cons(
+                            Cell::default(),
+                            Box::new((**prev).clone()),
+                            Box::new((**succ).clone()),
+                        );
+                        break;
                     }
                 }