correct handling of ! in phrase/{2,3}, get rid of extraneous choice points in put_atts/2 and get_atts/2, allow loading of non-module files from the command line and use_module/{2,3}

This commit is contained in:
Mark Thom
2019-10-02 15:51:48 -06:00
parent ccd3dfb436
commit a623061a1a
4 changed files with 79 additions and 51 deletions

View File

@@ -9,6 +9,8 @@ phrase(G, G) :-
nonvar(G), G = [_|_], !.
phrase(G, Ls0) :-
nonvar(G), G = (G1, G2), !, phrase(G1, Ls0, Ls1), phrase(G2, Ls1, []).
phrase(G, Ls0) :-
nonvar(G), G == !, !, Ls0 = [].
phrase(G, Ls0) :-
call(G, Ls0, []).
@@ -17,6 +19,8 @@ phrase(G, Ls0, Ls1) :-
phrase(G, Ls0, Ls2) :-
nonvar(G), G = (G1, G2), !,
phrase(G1, Ls0, Ls1), phrase(G2, Ls1, Ls2).
phrase(G, Ls0, Ls1) :-
nonvar(G), G == !, !, Ls0 = [], Ls1 = [].
phrase(G, Ls0, Ls1) :-
call(G, Ls0, Ls1).