]> Repositorios git - scryer-prolog.git/commitdiff
Add special case when parsing
authorNicolas Luck <[email protected]>
Thu, 27 Jul 2023 09:50:38 +0000 (11:50 +0200)
committerNicolas Luck <[email protected]>
Thu, 27 Jul 2023 09:50:38 +0000 (11:50 +0200)
src/machine/parsed_results.rs

index ba33089d150b877ab7a2ecd173aee48d9f9f075b..ecb58c1cb16a50daae381f51030ea3b441d08859 100644 (file)
@@ -66,6 +66,18 @@ impl From<Vec<QueryResolutionLine>> for QueryResolution {
             }
         }
 
+        // If there is only one line, and it is an empty match, return true.
+        if query_result_lines.len() == 1 {
+            match query_result_lines[0].clone() {
+                QueryResolutionLine::Match(m) => {
+                    if m.is_empty() {
+                        return QueryResolution::True;
+                    }
+                }
+                _ => {}
+            }
+        }
+
         // If there is at least one line with true and no matches, return true.
         if query_result_lines
             .iter()