[ ] 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; break;
case '[': case '[':
NextToken; NextToken;
t = ParseList(FailBuff); if (Yap_tokptr->Tok == Ord(Ponctuation_tok) &&
checkfor((Term) ']', FailBuff); Unsigned(Yap_tokptr->TokInfo) == ']') {
t = TermNil;
NextToken;
} else {
t = ParseList(FailBuff);
checkfor((Term) ']', FailBuff);
}
break; break;
case '{': case '{':
NextToken; NextToken;

View File

@ -1161,23 +1161,13 @@ Yap_tokenizer(int inp_stream)
case BK: case BK:
och = ch; och = ch;
do { ch = Nxtch(inp_stream);
ch = Nxtch(inp_stream); t->TokInfo = och;
} while (chtype(ch) == BS); if (t->TokInfo == '(' && !solo_flag) {
if (och == '[' && ch == ']') { t->TokInfo = 'l';
t->TokInfo = Unsigned(AtomNil); solo_flag = TRUE;
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);
} }
t->Tok = Ord(kind = Ponctuation_tok);
break; break;
case EF: case EF:

View File

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