about summary refs log tree commit diff
path: root/Src/parse.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-07-19 14:26:14 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-07-19 14:26:14 +0000
commitd6d4a3abfc84f0940e663cd69537789a039a7056 (patch)
tree5f5f40ae248c17c34fccbcadef85dddd4136b781 /Src/parse.c
parent1f6786ef7ae24ff858f52c6d4ac2bc23d529c0c1 (diff)
downloadzsh-d6d4a3abfc84f0940e663cd69537789a039a7056.tar.gz
zsh-d6d4a3abfc84f0940e663cd69537789a039a7056.tar.xz
zsh-d6d4a3abfc84f0940e663cd69537789a039a7056.zip
zsh-3.1.6-test-2 zsh-3.1.6-test-2
Diffstat (limited to 'Src/parse.c')
-rw-r--r--Src/parse.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/Src/parse.c b/Src/parse.c
index 626ffc982..658a66660 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -72,7 +72,13 @@ struct list dummy_list;
 
 #define YYERROR  { tok = LEXERR; return NULL; }
 #define YYERRORV { tok = LEXERR; return; }
-#define COND_ERROR(X,Y) do{herrflush();zerr(X,Y,0);YYERROR}while(0)
+#define COND_ERROR(X,Y) do { \
+  zwarn(X,Y,0); \
+  herrflush(); \
+  if (noerrs != 2) \
+    errflag = 1; \
+  YYERROR \
+} while(0)
 
 #define make_list()     allocnode(N_LIST)
 #define make_sublist()  allocnode(N_SUBLIST)
@@ -140,11 +146,13 @@ par_event(void)
     }
     if (!l) {
 	if (errflag) {
-	    yyerror();
+	    yyerror(0);
 	    return NULL;
 	}
+	yyerror(1);
 	herrflush();
-	yyerror();
+	if (noerrs != 2)
+	    errflag = 1;
 	return NULL;
     } else {
 	l->right = par_event();
@@ -163,7 +171,7 @@ parse_list(void)
     yylex();
     ret = par_list();
     if (tok == LEXERR) {
-	yyerror();
+	yyerror(0);
 	return NULL;
     }
     return ret;
@@ -1480,7 +1488,7 @@ par_cond_multi(char *a, LinkList l)
 
 /**/
 static void
-yyerror(void)
+yyerror(int noerr)
 {
     int t0;
 
@@ -1488,9 +1496,11 @@ yyerror(void)
 	if (!yytext || !yytext[t0] || yytext[t0] == '\n')
 	    break;
     if (t0 == 20)
-	zerr("parse error near `%l...'", yytext, 20);
+	zwarn("parse error near `%l...'", yytext, 20);
     else if (t0)
-	zerr("parse error near `%l'", yytext, t0);
+	zwarn("parse error near `%l'", yytext, t0);
     else
-	zerr("parse error", NULL, 0);
+	zwarn("parse error", NULL, 0);
+    if (!noerr && noerrs != 2)
+	errflag = 1;
 }