Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3

This commit is contained in:
Vítor Santos Costa 2011-05-01 22:51:14 +01:00
commit 97d216a9f3
3 changed files with 19 additions and 10 deletions

View File

@ -315,6 +315,11 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream)
return '\n'; return '\n';
case 'r': case 'r':
return '\r'; return '\r';
case 's': /* space */
if (yap_flags[CHARACTER_ESCAPE_FLAG] == ISO_CHARACTER_ESCAPES) {
return send_error_message("invalid escape sequence \\s");
} else
return ' ';
case 't': case 't':
return '\t'; return '\t';
case 'u': case 'u':
@ -357,6 +362,11 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream)
} }
case 'v': case 'v':
return '\v'; return '\v';
case 'z': /* Prolog end-of-file */
if (yap_flags[CHARACTER_ESCAPE_FLAG] == ISO_CHARACTER_ESCAPES) {
return send_error_message("invalid escape sequence \\z");
} else
return -1;
case '\\': case '\\':
return '\\'; return '\\';
case '\'': case '\'':

View File

@ -144,18 +144,18 @@ true :- true.
*/ */
/* main execution loop */ /* main execution loop */
'$read_vars'(user_input, Goal, Mod, Pos, Bindings) :- '$read_vars'(user_input, Goal, Mod, Pos, Bindings, Prompt) :-
'$swi_current_prolog_flag'(readline, true), '$swi_current_prolog_flag'(readline, true),
read_history(h, '!h', read_history(h, '!h',
[trace, end_of_file], [trace, end_of_file],
' ?- ', Goal, Bindings), !, Prompt, Goal, Bindings), !,
(nonvar(Err) -> (nonvar(Err) ->
print_message(error,Err), fail print_message(error,Err), fail
; ;
true true
). ).
'$read_vars'(Stream,T,Mod,Pos,V) :- '$read_vars'(Stream, T, Mod, Pos, V, _Prompt) :-
'$read'(true,T,Mod,V,Pos,Err,Stream), '$read'(true, T, Mod, V, Pos, Err, Stream),
(nonvar(Err) -> (nonvar(Err) ->
print_message(error,Err), fail print_message(error,Err), fail
; ;
@ -195,13 +195,12 @@ true :- true.
prompt(_,'| '), prompt(_,'| '),
prompt1(' ?- '), prompt1(' ?- '),
'$run_toplevel_hooks', '$run_toplevel_hooks',
'$read_vars'(user_input,Command,_,Pos,Varnames), '$read_vars'(user_input,Command,_,Pos,Varnames, ' ?- '),
nb_setval('$spy_gn',1), nb_setval('$spy_gn',1),
% stop at spy-points if debugging is on. % stop at spy-points if debugging is on.
nb_setval('$debug_run',off), nb_setval('$debug_run',off),
nb_setval('$debug_jump',off), nb_setval('$debug_jump',off),
prompt(_,'|: '), prompt1('|: '),
'$command'(Command,Varnames,Pos,top), '$command'(Command,Varnames,Pos,top),
'$sync_mmapped_arrays', '$sync_mmapped_arrays',
set_value('$live','$false'). set_value('$live','$false').
@ -1141,7 +1140,7 @@ bootstrap(F) :-
!. !.
'$enter_command'(Stream,Status) :- '$enter_command'(Stream,Status) :-
'$read_vars'(Stream,Command,_,Pos,Vars), '$read_vars'(Stream,Command,_,Pos,Vars, '|: '),
'$command'(Command,Vars,Pos,Status). '$command'(Command,Vars,Pos,Status).
'$abort_loop'(Stream) :- '$abort_loop'(Stream) :-

View File

@ -958,7 +958,7 @@ yap_flag(dialect,yap).
'$yap_flag_show_gc_tracing'(_, _, _, off). '$yap_flag_show_gc_tracing'(_, _, _, off).
'$flag_check_alias'(OUT, Alias) :- '$flag_check_alias'(OUT, Alias) :-
stream_property(OUT,[alias(Alias)]), !. stream_property(OUT,alias(Alias)), !.
current_prolog_flag(V,Out) :- current_prolog_flag(V,Out) :-
var(V), !, var(V), !,