From cab59d9f3a97ee05def5ba11da8b1787cc55786f Mon Sep 17 00:00:00 2001 From: vsc Date: Mon, 10 Mar 2008 14:11:38 +0000 Subject: [PATCH] [ ] should be processed by parser, not by scanner. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2136 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/parser.c | 10 ++++++++-- C/scanner.c | 22 ++++++---------------- changes-5.1.html | 2 ++ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/C/parser.c b/C/parser.c index 991e22028..160551c06 100644 --- a/C/parser.c +++ b/C/parser.c @@ -576,8 +576,14 @@ ParseTerm(int prio, JMPBUFF *FailBuff) break; case '[': NextToken; - t = ParseList(FailBuff); - checkfor((Term) ']', FailBuff); + if (Yap_tokptr->Tok == Ord(Ponctuation_tok) && + Unsigned(Yap_tokptr->TokInfo) == ']') { + t = TermNil; + NextToken; + } else { + t = ParseList(FailBuff); + checkfor((Term) ']', FailBuff); + } break; case '{': NextToken; diff --git a/C/scanner.c b/C/scanner.c index feea37127..c480d234d 100644 --- a/C/scanner.c +++ b/C/scanner.c @@ -1161,23 +1161,13 @@ Yap_tokenizer(int inp_stream) case BK: och = ch; - do { - ch = Nxtch(inp_stream); - } while (chtype(ch) == BS); - if (och == '[' && ch == ']') { - t->TokInfo = Unsigned(AtomNil); - ch = Nxtch(inp_stream); - t->Tok = Ord(kind = Name_tok); - if (ch == '(') - solo_flag = FALSE; - } else { - t->TokInfo = och; - if (t->TokInfo == '(' && !solo_flag) { - t->TokInfo = 'l'; - solo_flag = TRUE; - } - t->Tok = Ord(kind = Ponctuation_tok); + ch = Nxtch(inp_stream); + t->TokInfo = och; + if (t->TokInfo == '(' && !solo_flag) { + t->TokInfo = 'l'; + solo_flag = TRUE; } + t->Tok = Ord(kind = Ponctuation_tok); break; case EF: diff --git a/changes-5.1.html b/changes-5.1.html index 350594db8..609b6a380 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -17,6 +17,8 @@ xb

Yap-5.1.3: