]> Repositorios git - scryer-prolog.git/commitdiff
fix semicontext notation
authorMark Thom <[email protected]>
Tue, 16 Oct 2018 04:31:53 +0000 (22:31 -0600)
committerMark Thom <[email protected]>
Tue, 16 Oct 2018 04:31:53 +0000 (22:31 -0600)
src/prolog/lib/dcgs.pl

index 0d8eb0765426810157759f5613ca858195b982d4..43cbaad168f9dbdd7e521e52e33d4b5877ce4821 100644 (file)
@@ -25,12 +25,11 @@ term_expansion(Term0, (ModHead :- ModBody)) :-
     !,
     nonvar(Head),
     Head =.. [RuleName | Args],
-    append(Args, ['$VAR'(0), '$VAR'(N)], ModArgs), %% problematic line.
+    append([SC | SCs], '$VAR'(N), SemiContextArgs),
+    append(Args, ['$VAR'(0), SemiContextArgs], ModArgs),
     ModHead =.. [RuleName | ModArgs],
     nonvar(Body),
-    expand_body(Body, ModBody1, 0, N1),
-    expand_body_term([SC | SCs], ModBody2, N1, N),
-    ModBody = (ModBody1, ModBody2).
+    expand_body(Body, ModBody, 0, N).
 term_expansion(Term0, (ModHead :- ModBody)) :-
     nonvar(Term0),
     Term0 = (Head --> Body),