summaryrefslogtreecommitdiff
path: root/lib/parser.c
diff options
context:
space:
mode:
authorPixel <Pixel>2001-05-02 01:41:15 +0000
committerPixel <Pixel>2001-05-02 01:41:15 +0000
commitfba43d28682567fc21512b1a87ad045723cf06e9 (patch)
treedd27d546209acb7350b39a48ec782dbc05563716 /lib/parser.c
parent4115cde1a2045658f66cf1ba09e42556ec3cb7a5 (diff)
Blah
Diffstat (limited to 'lib/parser.c')
-rw-r--r--lib/parser.c14
1 files changed, 10 insertions, 4 deletions
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();
+ }
+ }
}