Changeset: 01456e1a1701 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=01456e1a1701
Modified Files:
monetdb5/mal/mal_parser.c
Branch: malparsing
Log Message:
Eat away text upon encountering a parsing error
After a parse error we skip to the next \n
before we attempt to parse again.
diffs (28 lines):
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -60,6 +60,7 @@ parseError(Client cntxt, str msg)
*s = ' ';
else
*s = *t;
+ cntxt->lineptr = t;
if( cntxt->line[strlen(cntxt->line)-1] =='\n')
strcat(new, "!");
else
@@ -778,7 +779,7 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
*curInstr = pushArgument(curBlk, *curInstr, idx);
} else if (*cntxt->lineptr == ':') {
tpe = typeElm(cntxt, TYPE_any);
- if (tpe < 0)
+ if (tpe < 0 || cntxt->curprg->def->errors)
return 3;
setPolymorphic(*curInstr, tpe, FALSE);
idx = newTypeVariable(curBlk, tpe);
@@ -1294,6 +1295,7 @@ parseStatement(Client cntxt, int cntrl)
if (l == 0 ) {
parseError(cntxt, "<identifier> expected\n");
freeInstruction(curInstr);
+ return;
}
GETvariable;
if (*cntxt->lineptr == ':') {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list