fix small bugs from changing style_check

This commit is contained in:
Vítor Santos Costa 2014-08-04 09:45:30 -05:00
parent 5c9468983f
commit 823175f50a
12 changed files with 23 additions and 31 deletions

View File

@ -618,9 +618,9 @@ file_search_path(path, C) :-
:- dynamic user:file_search_path/2.
user:file_search_path(library, Dir) :-
library_directory(Dir).
user:library_directory(Dir).
user:file_search_path(commons, Dir) :-
commons_directory(Dir).
user:commons_directory(Dir).
user:file_search_path(swi, Home) :-
current_prolog_flag(home, Home).
user:file_search_path(yap, Home) :-

View File

@ -653,15 +653,15 @@ true :- true.
'$process_directive'(G, _, M, VL, Pos) :-
( '$execute'(M:G) -> true ; format(user_error,':- ~w:~w failed.~n',[M,G]) ).
'$continue_with_command'(Where,V,'$stream_position'(C,_P,A1,A2,A3),'$source_location'(_F,L):G,Source) :- !,
'$continue_with_command'(Where,V,'$stream_position'(C,_P,A1,A2,A3),'$source_location'(_F,L):G,Source) :- !,
'$continue_with_command'(Where,V,'$stream_position'(C,L,A1,A2,A3),G,Source).
'$continue_with_command'(reconsult,V,Pos,G,Source) :-
'$continue_with_command'(reconsult,V,Pos,G,Source) :-
'$go_compile_clause'(G,V,Pos,5,Source),
fail.
'$continue_with_command'(consult,V,Pos,G,Source) :-
'$go_compile_clause'(G,V,Pos,13,Source),
'$continue_with_command'(consult,V,Pos,G,Source) :-
'$go_compile_clause'(G,V,Pos,13,Source),
fail.
'$continue_with_command'(top,V,_,G,_) :-
'$continue_with_command'(top,V,_,G,_) :-
'$query'(G,V).
%
@ -683,18 +683,9 @@ true :- true.
'$go_compile_clause'((M:H :- B),V,Pos,N,_,BodyMod,Source) :- !,
'$go_compile_clause'((H :- B),V,Pos,N,M,BodyMod,Source).
'$go_compile_clause'(G,V,Pos,N,HeadMod,BodyMod,Source) :- !,
'$prepare_term'(G, V, Pos, G0, G1, BodyMod, HeadMod, Source),
'$precompile_term'(G, G0, G1, BodyMod, SourceMod),
'$$compile'(G1, G0, N, HeadMod).
'$prepare_term'(G, V, Pos, G0, G1, BodyMod, SourceMod, Source) :-
(
get_value('$syntaxcheckflag',on)
->
'$check_term'(Source, G, V, Pos, BodyMod)
;
true
),
'$precompile_term'(G, G0, G1, BodyMod, SourceMod).
% process an input clause
'$$compile'(G, G0, L, Mod) :-

View File

@ -64,7 +64,6 @@
:- system_module( style_checker, [no_style_check/1,
style_check/1], ['$check_term'/5,
'$init_style_check'/1,
'$sv_warning'/2,
'$syntax_check_discontiguous'/2,
'$syntax_check_multiple'/2,
@ -183,7 +182,7 @@ no_style_check(-single_var) :-
no_style_check(-singleton) :-
'$style_checker'( [ -singleton ] ).
no_style_check(-discontiguous) :-
'$stylechecker'( [ -discontiguous ] ).
'$style_checker'( [ -discontiguous ] ).
no_style_check(-multiple) :-
'$style_checker'( [ -multiple ] ).
no_style_check([]).

View File

@ -54,8 +54,6 @@
'$loop'/2,
'$system_catch'/4]).
:- use_system_module( '$_checker', ['$init_style_check'/1]).
:- use_system_module( '$_errors', ['$do_error'/2]).
:- use_system_module( '$_load_foreign', ['$import_foreign'/3]).

View File

@ -65,8 +65,8 @@ source_exports(Source, Export) :-
open_source(Source, In),
catch(call_cleanup(exports(In, Exports), close(In)), _, fail),
( ground(Export)
-> memberchk(Export, Exports)
; member(Export, Exports)
-> lists:memberchk(Export, Exports)
; lists:member(Export, Exports)
).
%% open_source(+Source, -In:stream) is semidet.

View File

@ -204,7 +204,9 @@
'$do_error'(Type,Message) :-
format('~w~n', [Type]),
'$current_stack'(local_sp(_,CP,Envs,CPs)),
'$stack_dump',
throw(error(Type,[Message|local_sp(Message,CP,Envs,CPs)])).
'$Error'(E) :-
@ -218,7 +220,7 @@
'$process_error'(Error, Level),
fail.
'$LoopError'(_, _) :-
flush_all_streams,
flush_output,
fail.
'$process_error'('$abort', top) :- !,

View File

@ -83,7 +83,7 @@ yap_flag(gc_margin,N) :-
( var(N) ->
get_value('$gc_margin',N)
;
integer(N), N >0 ->
integer(N), N >=0 ->
set_value('$gc_margin',N)
;
'$do_error'(domain_error(flag_value,gc_margin+X),yap_flag(gc_margin,X))

View File

@ -20,10 +20,9 @@
[display_stack_info/4,
display_stack_info/6,
display_pc/3,
code_location/3,
'$stack_dump'/0]).
code_location/3]).
'$stack_dump' :-
prolog:'$stack_dump' :-
yap_hacks:current_choicepoints(CPs),
yap_hacks:current_continuations([Env|Envs]),
yap_hacks:continuation(Env,_,ContP,_),

View File

@ -30,7 +30,7 @@
*/
:- module('$history',
[ read_history/6,
[ %read_history/6,
'$clean_history'/0,
'$save_history'/1
]).

View File

@ -989,7 +989,7 @@ its parent goal.
'$is_mt'(M, _, B, B, M).
% comma has its own problems.
:- '$install_meta_predicate'((0,0), prolog).
:- '$install_meta_predicate'(','(0,0), prolog).
:- meta_predicate
abolish(:),

View File

@ -241,7 +241,7 @@ assertz_static(C) :-
'$head_and_body'(C0, H0, B0),
'$recordap'(Mod:Head,(H0 :- B0),R,CR),
( '$is_multifile'(Head, Mod) ->
sourcee_location(F, _),
source_location(F, _),
functor(H0, Na, Ar),
recorda('$multifile_dynamic'(_,_,_), '$mf'(Na,Ar,Mod,F,R), _)
;

View File

@ -217,7 +217,10 @@ save_program(File, _Goal) :-
yap_flag(M:unknown, V).
'$x_yap_flag'(X, V) :-
yap_flag(X, V),
X \= gc_margin, % different machines will have different needs,
X \= language,
X \= max_threads,
X \= max_workers,
X \= readline,
X \= timezone,
X \= tty_control,