Skip to content

Commit

Permalink
ENHANCED: gui tracer support for Head ==> Body rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
JanWielemaker committed Dec 2, 2024
1 parent 5f7de8a commit d5b6bcb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions library/prolog_clause.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Author: Jan Wielemaker
E-mail: [email protected]
WWW: http://www.swi-prolog.org
Copyright (c) 2005-2023, University of Amsterdam
Copyright (c) 2005-2024, University of Amsterdam
VU University Amsterdam
CWI, Amsterdam
SWI-Prolog Solutions b.v.
Expand Down Expand Up @@ -280,8 +280,10 @@
functor(Bindings, varnames, L),
do_make_varnames(Offsets, Names, Bindings).

dcg_head((Head --> _Body), Head).
dcg_head((Head ==> _Body), Head).
dcg_head((Head,_ --> _Body), Head).
dcg_head((Head --> _Body), Head).
dcg_head((Head,_ ==> _Body), Head).
dcg_head((Head ==> _Body), Head).

do_make_varnames([], _, _).
do_make_varnames([N=Var|TO], Names, Bindings) :-
Expand Down Expand Up @@ -405,6 +407,12 @@
unify_clause((Head => Body), Compiled1, Module, TermPos0, TermPos) :-
!,
unify_clause2((Head :- Body), Compiled1, Module, TermPos0, TermPos).
unify_clause(Read, Compiled1, Module, TermPos0, TermPos) :-
Read = (_ ==> _),
ci_expand(Read, Compiled2, Module, TermPos0, TermPos1),
Compiled2 \= (_ ==> _),
!,
unify_clause(Compiled2, Compiled1, Module, TermPos1, TermPos).
unify_clause(Read, Decompiled, Module, TermPos0, TermPos) :-
unify_clause2(Read, Decompiled, Module, TermPos0, TermPos).

Expand Down

0 comments on commit d5b6bcb

Please sign in to comment.