checker should be called after preprocessing (obs from Roberto Bagnara).

This commit is contained in:
Vítor Santos Costa 2010-12-12 19:19:49 +00:00
parent 51e9cb14a7
commit 7c2c3febe5
2 changed files with 16 additions and 9 deletions

View File

@ -461,9 +461,14 @@ true :- true.
'$$compile'(G1, G0, N, HeadMod).
'$prepare_term'(G, V, Pos, G0, G1, BodyMod, SourceMod, Source) :-
( get_value('$syntaxcheckflag',on) ->
'$check_term'(Source, V, Pos, BodyMod) ; true ),
'$precompile_term'(G, G0, G1, BodyMod, SourceMod).
'$precompile_term'(G, G0, G1, BodyMod, SourceMod),
(
get_value('$syntaxcheckflag',on)
->
'$check_term'(G0, V, Pos, Source, BodyMod)
;
true
).
% process an input clause
'$$compile'(G, G0, L, Mod) :-

View File

@ -120,20 +120,22 @@ no_style_check([H|T]) :- no_style_check(H), no_style_check(T).
'$values'('$syntaxcheckmultiple',O,N).
'$check_term'(T,_,P,M) :-
'$check_term'(T,_,P,_Source,M) :-
get_value('$syntaxcheckdiscontiguous',on),
'$xtract_head'(T,M,NM,_,F,A),
'$handle_discontiguous'(F,A,NM), fail.
'$check_term'(T,_,P,M) :-
'$check_term'(T,_,P,_Source,M) :-
get_value('$syntaxcheckmultiple',on),
'$xtract_head'(T,M,NM,_,F,A),
'$handle_multiple'(F,A,NM), fail.
'$check_term'(T,VL,P,_) :-
'$check_term'(T,VL,P,_Source,_) :-
get_value('$syntaxchecksinglevar',on),
( '$chk_binding_vars'(T),
'$sv_list'(VL,Sv) ->
'$sv_warning'(Sv,T) ), fail.
'$check_term'(_,_,_,_).
'$sv_list'(VL,Sv)
->
'$sv_warning'(Sv,T)
), fail.
'$check_term'(_,_,_,_,_).
'$chk_binding_vars'(V) :- var(V), !, V = '$V'(_).
'$chk_binding_vars'('$V'(off)) :- !.