]> Repositorios git - scryer-prolog.git/commitdiff
modify structural_eq_test
authorMark Thom <[email protected]>
Sun, 26 Aug 2018 08:03:16 +0000 (02:03 -0600)
committerMark Thom <[email protected]>
Sun, 26 Aug 2018 08:03:16 +0000 (02:03 -0600)
src/prolog/machine/machine_state_impl.rs

index 850b006846180427a41b4bc152b8711a1c40b919..ee68a2e57169519aa6b9f4fdb133b14ac5360ddd 100644 (file)
@@ -337,7 +337,15 @@ impl MachineState {
             Addr::StackCell(fr, sc) => {
                 self.and_stack[fr][sc] = Addr::Con(c.clone());
                 self.trail(Ref::StackCell(fr, sc));
-            },
+            },            
+            Addr::Con(Constant::String(s)) =>            
+                self.fail = match c {
+                    Constant::EmptyList
+                      if self.flags.double_quotes.is_chars() =>
+                        !s.is_empty(),
+                    Constant::String(s2) => s != s2,
+                    _ => true
+                },
             Addr::Con(c1) => {
                 if c1 != c {
                     self.fail = true;
@@ -1770,19 +1778,7 @@ impl MachineState {
                  HeapCellValue::Addr(Addr::Con(Constant::String(ref s))))
                     if self.flags.double_quotes.is_chars() => if !s.is_empty() {
                         return true;
-                    },
-                (HeapCellValue::Addr(Addr::Con(Constant::Atom(atom))),
-                 HeapCellValue::Addr(Addr::Con(Constant::Char(c))))
-              | (HeapCellValue::Addr(Addr::Con(Constant::Char(c))),
-                 HeapCellValue::Addr(Addr::Con(Constant::Atom(atom)))) => {
-                  if atom.as_str().chars().count() == 1 {
-                      if Some(c) == atom.as_str().chars().next() {
-                          continue;
-                      }
-                  }
-                  
-                  return true;
-                },
+                    },                
                 (HeapCellValue::NamedStr(ar1, n1, _), HeapCellValue::NamedStr(ar2, n2, _)) =>
                     if ar1 != ar2 || n1 != n2 {
                         return true;