[ ] 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
This commit is contained in:
vsc 2008-03-10 14:11:38 +00:00
parent 93e6f17c3b
commit cab59d9f3a
3 changed files with 16 additions and 18 deletions

View File

@ -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;

View File

@ -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:

View File

@ -17,6 +17,8 @@ xb
<h2>Yap-5.1.3:</h2>
<ul>
<li> FIXED: [ ] should be processed by parser, not by scanner (obs
from Samir Genaim).</li>
<li> NEW: file_base_name/2.</li>
<li> FIXED: in console, count input characters as being output, as they
are also supposed to be displayed by the console manager.</li>