correct dcg handling of cuts
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "scryer-prolog"
|
name = "scryer-prolog"
|
||||||
version = "0.8.100"
|
version = "0.8.101"
|
||||||
authors = ["Mark Thom <markjordanthom@gmail.com>"]
|
authors = ["Mark Thom <markjordanthom@gmail.com>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
repository = "https://github.com/mthom/scryer-prolog"
|
repository = "https://github.com/mthom/scryer-prolog"
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ expand_body_term((P ; Q), (PModTerm ; QModTerm), N0, N) :-
|
|||||||
PModTerm = PModTerm0,
|
PModTerm = PModTerm0,
|
||||||
N = N1
|
N = N1
|
||||||
).
|
).
|
||||||
|
expand_body_term(!, !, N, N) :- !.
|
||||||
expand_body_term(CommaTerm, ModTerm, N, N) :-
|
expand_body_term(CommaTerm, ModTerm, N, N) :-
|
||||||
CommaTerm =.. [{} | BodyTerms], !,
|
CommaTerm =.. [{} | BodyTerms], !,
|
||||||
comma_ify(BodyTerms, ModTerm).
|
comma_ify(BodyTerms, ModTerm).
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ freeze(X, Goal) :-
|
|||||||
Fresh = X.
|
Fresh = X.
|
||||||
|
|
||||||
gather_freeze_goals(Attrs, _) -->
|
gather_freeze_goals(Attrs, _) -->
|
||||||
{ var(Attrs), ! }.
|
{ var(Attrs) },
|
||||||
|
!.
|
||||||
gather_freeze_goals([frozen(X) | _], Var) -->
|
gather_freeze_goals([frozen(X) | _], Var) -->
|
||||||
[freeze(Var, X)],
|
[freeze(Var, X)],
|
||||||
{ ! }.
|
!.
|
||||||
gather_freeze_goals([_ | Attrs], Var) -->
|
gather_freeze_goals([_ | Attrs], Var) -->
|
||||||
gather_freeze_goals(Attrs, Var).
|
gather_freeze_goals(Attrs, Var).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user