This commit is contained in:
Vitor Santos Costa
2018-10-28 10:10:40 +00:00
parent 7381bf0d84
commit ebd4dffed3
7 changed files with 89 additions and 78 deletions

View File

@@ -345,14 +345,14 @@ static Term syntax_error(TokEntry *errtok, int sno, Term cmod, Int newpos, bool
Yap_local.ActiveError->parserFile =
RepAtom(AtomOfTerm((GLOBAL_Stream+sno)->user_name))->StrOfAE;
Yap_local.ActiveError->parserReadingCode = code;
int lvl = push_text_stack();
if (GLOBAL_Stream[sno].status & Seekable_Stream_f) {
char *o, *o2;
#if HAVE_FTELLO
fseeko(GLOBAL_Stream[sno].file, startpos, SEEK_SET);
#else
fseek(GLOBAL_Stream[sno].file, startpos, SEEK_SET);
#endif
int lvl = push_text_stack();
if (GLOBAL_Stream[sno].status & Seekable_Stream_f) {
char *o, *o2;
if (errpos <= startpos) {
o = malloc(1);
o[0] = '\0';