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