handle SY of wide characters.
This commit is contained in:
parent
27299d432f
commit
d8b5a0e5d5
29
C/scanner.c
29
C/scanner.c
@ -1260,13 +1260,32 @@ Yap_tokenizer(IOSTREAM *inp_stream, int store_comments, Term *tposp)
|
|||||||
while ((ch = getchr(inp_stream)) != 10 && chtype(ch) != EF);
|
while ((ch = getchr(inp_stream)) != 10 && chtype(ch) != EF);
|
||||||
t->Tok = Ord(kind = eot_tok);
|
t->Tok = Ord(kind = eot_tok);
|
||||||
} else {
|
} else {
|
||||||
|
Atom ae;
|
||||||
TokImage = ((AtomEntry *) ( Yap_PreAllocCodeSpace()))->StrOfAE;
|
TokImage = ((AtomEntry *) ( Yap_PreAllocCodeSpace()))->StrOfAE;
|
||||||
charp = TokImage;
|
charp = TokImage;
|
||||||
*charp++ = och;
|
wcharp = NULL;
|
||||||
for (; chtype(ch) == SY; ch = getchr(inp_stream))
|
add_ch_to_buff(och);
|
||||||
*charp++ = ch;
|
for (; chtype(ch) == SY; ch = getchr(inp_stream)) {
|
||||||
*charp = '\0';
|
if (charp == (char *)AuxSp-1024) {
|
||||||
t->TokInfo = Unsigned(Yap_LookupAtom(TokImage));
|
goto huge_var_error;
|
||||||
|
}
|
||||||
|
add_ch_to_buff(ch);
|
||||||
|
}
|
||||||
|
add_ch_to_buff('\0');
|
||||||
|
if (wcharp) {
|
||||||
|
ae = Yap_LookupWideAtom((wchar_t *)TokImage);
|
||||||
|
} else {
|
||||||
|
ae = Yap_LookupAtom(TokImage);
|
||||||
|
}
|
||||||
|
if (ae == NIL) {
|
||||||
|
LOCAL_Error_TYPE = OUT_OF_HEAP_ERROR;
|
||||||
|
LOCAL_ErrorMessage = "Code Space Overflow";
|
||||||
|
if (p)
|
||||||
|
t->Tok = Ord(kind = eot_tok);
|
||||||
|
/* serious error now */
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
t->TokInfo = Unsigned(ae);
|
||||||
if (t->TokInfo == (CELL)NIL) {
|
if (t->TokInfo == (CELL)NIL) {
|
||||||
LOCAL_Error_TYPE = OUT_OF_HEAP_ERROR;
|
LOCAL_Error_TYPE = OUT_OF_HEAP_ERROR;
|
||||||
LOCAL_ErrorMessage = "Code Space Overflow";
|
LOCAL_ErrorMessage = "Code Space Overflow";
|
||||||
|
Reference in New Issue
Block a user