From 83e941e4cf17e62dd7f5e3ffe8b110919e309254 Mon Sep 17 00:00:00 2001 From: vsc Date: Thu, 7 Feb 2008 23:09:13 +0000 Subject: [PATCH] don't break ISO standard in current_predicate/1. Include Nicos flag. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2081 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/scanner.c | 8 ++++++++ C/stdpreds.c | 11 ++++++++++- H/Yap.h | 5 +++-- changes-5.1.html | 4 +++- pl/directives.yap | 14 ++++++++++++++ pl/preds.yap | 18 +++++++++--------- 6 files changed, 47 insertions(+), 13 deletions(-) diff --git a/C/scanner.c b/C/scanner.c index affb9f9e3..feea37127 100644 --- a/C/scanner.c +++ b/C/scanner.c @@ -805,6 +805,7 @@ Yap_tokenizer(int inp_stream) *charp++ = och; for (; chtype(ch) <= NU; ch = Nxtch(inp_stream)) { if (charp == (char *)AuxSp-1024) { + huge_var_error: /* huge atom or variable, we are in trouble */ Yap_ErrorMessage = "Code Space Overflow due to huge atom"; Yap_Error_TYPE = OUT_OF_AUXSPACE_ERROR; @@ -817,6 +818,13 @@ Yap_tokenizer(int inp_stream) } *charp++ = ch; } + while (ch == '\'' && isvar && yap_flags[VARS_CAN_HAVE_QUOTE_FLAG]) { + if (charp == (char *)AuxSp-1024) { + goto huge_var_error; + } + *charp++ = ch; + ch = Nxtch(inp_stream); + } *charp++ = '\0'; if (!isvar) { /* don't do this in iso */ diff --git a/C/stdpreds.c b/C/stdpreds.c index 609f78df5..476808aa3 100644 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -11,8 +11,12 @@ * File: stdpreds.c * * comments: General-purpose C implemented system predicates * * * -* Last rev: $Date: 2008-01-23 17:57:53 $,$Author: vsc $ * +* Last rev: $Date: 2008-02-07 23:09:13 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.125 2008/01/23 17:57:53 vsc +* valgrind it! +* enable atom garbage collection. +* * Revision 1.124 2007/11/26 23:43:08 vsc * fixes to support threads and assert correctly, even if inefficiently. * @@ -3607,6 +3611,11 @@ p_set_yap_flags(void) } break; #endif /* TABLING */ + case VARS_CAN_HAVE_QUOTE_FLAG: + if (value != 0 && value != 1) + return(FALSE); + yap_flags[VARS_CAN_HAVE_QUOTE_FLAG] = value; + break; default: return(FALSE); } diff --git a/H/Yap.h b/H/Yap.h index d7301eff0..ae65c9c44 100644 --- a/H/Yap.h +++ b/H/Yap.h @@ -10,7 +10,7 @@ * File: Yap.h.m4 * * mods: * * comments: main header file for YAP * -* version: $Id: Yap.h,v 1.25 2008-01-28 10:42:20 vsc Exp $ * +* version: $Id: Yap.h,v 1.26 2008-02-07 23:09:13 vsc Exp $ * *************************************************************************/ #include "config.h" @@ -520,8 +520,9 @@ typedef enum GENERATE_DEBUG_INFO_FLAG = 18, INDEXING_MODE_FLAG = 19, TABLING_MODE_FLAG = 20, + VARS_CAN_HAVE_QUOTE_FLAG = 21, /* let this be the last one */ - LAST_FLAG = 21 + LAST_FLAG = 22 } yap_flags; #define STRING_AS_CHARS 0 diff --git a/changes-5.1.html b/changes-5.1.html index a602e077d..8f3c43511 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -17,8 +17,10 @@ xb

Yap-5.1.3: