From fba43d28682567fc21512b1a87ad045723cf06e9 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 2 May 2001 01:41:15 +0000 Subject: Blah --- lib/parser.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/parser.c') diff --git a/lib/parser.c b/lib/parser.c index ef3f0e9..3483d1e 100644 --- a/lib/parser.c +++ b/lib/parser.c @@ -208,8 +208,8 @@ void parse_line(char *line) exception(1, _("Invalid binary operator")); } } - while ((get_pri(get_last_op()) >= get_pri(buffer[0])) - && ((get_last_op() & 127) != '(')) { + while (((get_pri(get_last_op()) >= get_pri(buffer[0])) + && ((get_last_op() & 127) != '(')) && !global_error) { act_pile(get_func(pop_op())); got_unary = 0; } @@ -226,7 +226,7 @@ void parse_line(char *line) switch (buffer[0]) { case ';': /* Equivalent a fin de ligne */ - while (pileop_pos) { + while ((pileop_pos) && !global_error) { op = pop_op(); if (op == '(') exception(1, _("Parse error: too much left parenthesis")); @@ -236,7 +236,7 @@ void parse_line(char *line) break; case ')': /* Fin de parenthese (Appel de fonction ou expression mathématique) */ - while (1) { + while (!global_error) { if (!pileop_pos) exception(1, _("Parse error: too much right parenthesis")); op = pop_op(); @@ -271,4 +271,10 @@ void parse_line(char *line) popcontext(); } popcontext(); + if (global_error) { + got_unary = 0; + while (pileop_pos) { + pop_op(); + } + } } -- cgit v1.2.3