From 5033588754f1fb729026a7b411d369453aa737b3 Mon Sep 17 00:00:00 2001 From: Theofrastos Mantadelis Date: Wed, 24 Nov 2010 18:39:07 +0100 Subject: [PATCH 1/4] corrected an extension error --- library/block_diagram.yap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/block_diagram.yap b/library/block_diagram.yap index d99134bce..d4d4f6e64 100644 --- a/library/block_diagram.yap +++ b/library/block_diagram.yap @@ -219,7 +219,7 @@ parameter(texts((+inf))). parameter(depth((+inf))). -parameter(default_ext('.dot')). +parameter(default_ext('.yap')). make_diagram(InputFile, OutputFile):- tell(OutputFile), write('digraph G {\nrankdir=BT'), nl, From 44105c6c4972e6594423102033822a530e8fe43d Mon Sep 17 00:00:00 2001 From: Theofrastos Mantadelis Date: Wed, 24 Nov 2010 21:53:16 +0100 Subject: [PATCH 2/4] forgot to add :-D --- library/charsio.yap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/charsio.yap b/library/charsio.yap index 313941196..416627bf0 100644 --- a/library/charsio.yap +++ b/library/charsio.yap @@ -28,7 +28,8 @@ open_chars_stream/2, with_output_to_chars/2, 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,?)). From 969dcfa98ccd646ef215c4daf3eea9a30e6382a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 25 Nov 2010 16:33:25 +0000 Subject: [PATCH 3/4] save should set slots. --- C/save.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C/save.c b/C/save.c index b5154a213..eaafd1a9b 100755 --- a/C/save.c +++ b/C/save.c @@ -608,6 +608,8 @@ do_save(int mode) { static Int p_save(void) { + Int res; + #if defined(YAPOR) && !defined(THREADS) if (number_workers != 1) { Yap_Error(SYSTEM_ERROR,TermNil,"cannot perform save: more than a worker/thread running"); @@ -620,7 +622,10 @@ p_save(void) } #endif which_save = 1; - return(do_save(DO_EVERYTHING)); + Yap_StartSlots(); + res = do_save(DO_EVERYTHING); + Yap_CloseSlots(); + return res; } /* Saves a complete prolog environment */ From 471cc93f6cdaee5b86e21fe7bdd11009f0559f3c Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 26 Nov 2010 23:36:50 +0000 Subject: [PATCH 4/4] fix some bad code in legalAtom, allowing /a/b not to be quoted (obs from Paulo Moura). --- C/write.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/C/write.c b/C/write.c index 504c2bdf2..740359f0e 100755 --- a/C/write.c +++ b/C/write.c @@ -292,29 +292,30 @@ wrputref(CODEADDR ref, int Quote_illegal, wrf writewch) /* writes a data base static int legalAtom(unsigned char *s) /* Is this a legal atom ? */ - { wchar_t ch = *s; if (ch == '\0') - return(FALSE); + return FALSE; if (Yap_chtype[ch] != LC) { - if (ch == '[') - return (*++s == ']' && !(*++s)); - else if (ch == '{') - return (*++s == '}' && !(*++s)); + if (ch == '[') { + return (s[1] == ']' && !s[2]); + } else if (ch == '{') { + return (s[1] == '}' && !s[2]); // else if (ch == '/') // return (*++s != '*'); - else if (Yap_chtype[ch] == SL) - return (!*++s); - else if ((ch == ',' || ch == '.') && !s[1]) + } else if (Yap_chtype[ch] == SL) { + return (!s[1]); + } else if ((ch == ',' || ch == '.') && !s[1]) { return FALSE; - else + } else { while (ch) { - if (Yap_chtype[ch] != SY) + if (Yap_chtype[ch] != SY) { return FALSE; + } ch = *++s; } + } return TRUE; } else while ((ch = *++s) != 0)