add spaces between operators when there is an ambiguity

This commit is contained in:
Mark Thom
2018-10-08 23:04:03 -06:00
parent 9a6094bad2
commit 41b8f7a36b
2 changed files with 142 additions and 47 deletions

View File

@@ -39,7 +39,8 @@ term_expansion(Term0, (ModHead :- ModBody)) :-
append(Args, ['$VAR'(0), '$VAR'(N)], ModArgs),
ModHead =.. [RuleName | ModArgs],
nonvar(Body),
expand_body(Body, ModBody, 0, N).
expand_body(Body, ModBody, 0, N),
writeq((ModHead :- ModBody)).
expand_body((Term, Terms), (ModTerm, ModTerms), N0, N) :-
!, expand_body_term(Term, ModTerm, N0, N1),