Merge ../yap-6.2

This commit is contained in:
Vitor Santos Costa 2010-11-26 23:37:36 +00:00
commit 55d28f6ad5
4 changed files with 21 additions and 14 deletions

View File

@ -608,6 +608,8 @@ do_save(int mode) {
static Int static Int
p_save(void) p_save(void)
{ {
Int res;
#if defined(YAPOR) && !defined(THREADS) #if defined(YAPOR) && !defined(THREADS)
if (number_workers != 1) { if (number_workers != 1) {
Yap_Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running"); Yap_Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running");
@ -620,7 +622,10 @@ p_save(void)
} }
#endif #endif
which_save = 1; which_save = 1;
return(do_save(DO_EVERYTHING)); Yap_StartSlots();
res = do_save(DO_EVERYTHING);
Yap_CloseSlots();
return res;
} }
/* Saves a complete prolog environment */ /* Saves a complete prolog environment */

View File

@ -293,29 +293,30 @@ wrputref(CODEADDR ref, int Quote_illegal, wrf writewch) /* writes a data base
static int static int
legalAtom(unsigned char *s) /* Is this a legal atom ? */ legalAtom(unsigned char *s) /* Is this a legal atom ? */
{ {
wchar_t ch = *s; wchar_t ch = *s;
if (ch == '\0') if (ch == '\0')
return(FALSE); return FALSE;
if (Yap_chtype[ch] != LC) { if (Yap_chtype[ch] != LC) {
if (ch == '[') if (ch == '[') {
return (*++s == ']' && !(*++s)); return (s[1] == ']' && !s[2]);
else if (ch == '{') } else if (ch == '{') {
return (*++s == '}' && !(*++s)); return (s[1] == '}' && !s[2]);
// else if (ch == '/') // else if (ch == '/')
// return (*++s != '*'); // return (*++s != '*');
else if (Yap_chtype[ch] == SL) } else if (Yap_chtype[ch] == SL) {
return (!*++s); return (!s[1]);
else if ((ch == ',' || ch == '.') && !s[1]) } else if ((ch == ',' || ch == '.') && !s[1]) {
return FALSE; return FALSE;
else } else {
while (ch) { while (ch) {
if (Yap_chtype[ch] != SY) if (Yap_chtype[ch] != SY) {
return FALSE; return FALSE;
}
ch = *++s; ch = *++s;
} }
}
return TRUE; return TRUE;
} else } else
while ((ch = *++s) != 0) while ((ch = *++s) != 0)

View File

@ -219,7 +219,7 @@
parameter(texts((+inf))). parameter(texts((+inf))).
parameter(depth((+inf))). parameter(depth((+inf))).
parameter(default_ext('.dot')). parameter(default_ext('.yap')).
make_diagram(InputFile, OutputFile):- make_diagram(InputFile, OutputFile):-
tell(OutputFile), tell(OutputFile),
write('digraph G {\nrankdir=BT'), nl, write('digraph G {\nrankdir=BT'), nl,

View File

@ -28,7 +28,8 @@
open_chars_stream/2, open_chars_stream/2,
with_output_to_chars/2, with_output_to_chars/2,
with_output_to_chars/3, with_output_to_chars/3,
with_output_to_chars/4 with_output_to_chars/4,
term_to_atom/2
]). ]).
:- meta_predicate(with_output_to_chars(0,?)). :- meta_predicate(with_output_to_chars(0,?)).