From: Nicolas Luck Date: Thu, 27 Jul 2023 09:50:38 +0000 (+0200) Subject: Add special case when parsing X-Git-Tag: remove^2~50 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=0d28404aad4acd5a416a5182fb6363771ccff3da;p=scryer-prolog.git Add special case when parsing --- diff --git a/src/machine/parsed_results.rs b/src/machine/parsed_results.rs index ba33089d..ecb58c1c 100644 --- a/src/machine/parsed_results.rs +++ b/src/machine/parsed_results.rs @@ -66,6 +66,18 @@ impl From> 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()