From 9a6094bad2f26b534621482e8ef3826a19d630ab Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Mon, 8 Oct 2018 11:02:48 -0600 Subject: [PATCH] correct phrase/2 --- src/prolog/lib/dcgs.pl | 2 +- src/tests.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prolog/lib/dcgs.pl b/src/prolog/lib/dcgs.pl index 7bad6997..6ff86a79 100644 --- a/src/prolog/lib/dcgs.pl +++ b/src/prolog/lib/dcgs.pl @@ -9,7 +9,7 @@ phrase(G, Ls0) :- phrase(G, Ls0) :- nonvar(G), G = (G1, G2), !, phrase(G1, Ls0, Ls1), phrase(G2, Ls1). phrase(G, Ls0) :- - call(G, Ls0, _). + call(G, Ls0, []). phrase(G, Ls0, Ls1) :- nonvar(G), G = [_|_], !, append(G, Ls1, Ls0). diff --git a/src/tests.rs b/src/tests.rs index c6e182c9..d963f392 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1890,9 +1890,9 @@ fn test_queries_on_dcgs() instant('Lightning Bolt') --> [].".as_bytes()); assert_prolog_success!(&mut wam, "?- phrase(ability(destroy, X), P).", - [["P = [destroy, target, creature | _4]", "X = 'Llanowar Elves'"], - ["P = [destroy, target, artifact | _4]", "X = 'Ankh of Mishra'"], - ["P = [destroy, target, land | _4]", "X = 'Mountain'"]]); + [["P = [destroy, target, creature]", "X = 'Llanowar Elves'"], + ["P = [destroy, target, artifact]", "X = 'Ankh of Mishra'"], + ["P = [destroy, target, land]", "X = 'Mountain'"]]); } #[test] -- 2.54.0