aboutsummaryrefslogtreecommitdiffstats
path: root/res/ael/ael.y
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-23 23:37:33 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-23 23:37:33 +0000
commit652b0b33acb626aee657d9429c40b34c928ddf3e (patch)
tree41688397c81528113e4a599ac7d3acea1216753c /res/ael/ael.y
parent60b1eb4ffaf0ed3df5659e7025fe7b141bae2bc7 (diff)
an unreported crash I debugged, looked like it was backing up way too far after hitting the syntax error. An inspection of the code revealed that error tokens in lists were not rearranged when the rules were rearranged as part of a code neatening-up process. By moving the error tokens to where they should be, I also reduced the number of shift/reduce conflicts to 3 instead of 8. This introduces subtle differences in error messages, so the regressions had to be updated.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80649 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/ael/ael.y')
-rw-r--r--res/ael/ael.y12
1 files changed, 6 insertions, 6 deletions
diff --git a/res/ael/ael.y b/res/ael/ael.y
index 5d0a1c1a2..c1f04fd64 100644
--- a/res/ael/ael.y
+++ b/res/ael/ael.y
@@ -154,7 +154,7 @@ static pval *update_last(pval *, YYLTYPE *);
/* there will be two shift/reduce conflicts, they involve the if statement, where a single statement occurs not wrapped in curlies in the "true" section
the default action to shift will attach the else to the preceeding if. */
-%expect 8
+%expect 3
%error-verbose
/*
@@ -234,7 +234,7 @@ globals : KW_GLOBALS LC global_statements RC {
global_statements : { $$ = NULL; }
| assignment global_statements {$$ = linku1($1, $2); }
- | global_statements error {$$=$1;}
+ | error global_statements {$$=$2;}
;
assignment : word EQ { reset_semicount(parseio->scanner); } word SEMI {
@@ -258,7 +258,7 @@ arglist : /* empty */ { $$ = NULL; }
elements : {$$=0;}
| element elements { $$ = linku1($1, $2); }
- | elements error { $$=$1;}
+ | error elements { $$=$2;}
;
element : extension {$$=$1;}
@@ -303,7 +303,7 @@ extension : word EXTENMARK statement {
/* list of statements in a block or after a case label - can be empty */
statements : /* empty */ { $$ = NULL; }
| statement statements { $$ = linku1($1, $2); }
- | statements error {$$=$1;}
+ | error statements {$$=$2;}
;
/* hh:mm-hh:mm, due to the way the parser works we do not
@@ -478,7 +478,7 @@ statement : LC statements RC {
opt_else : KW_ELSE statement { $$ = $2; }
| { $$ = NULL ; }
-
+
target : goto_word { $$ = nword($1, &@1); }
| goto_word BAR goto_word {
$$ = nword($1, &@1);
@@ -607,7 +607,7 @@ switchlist : /* empty */ { $$ = NULL; }
| word SEMI switchlist { $$ = linku1(nword($1, &@1), $3); }
| word AT word SEMI switchlist { char *x; asprintf(&x,"%s@%s", $1,$3); free($1); free($3);
$$ = linku1(nword(x, &@1), $5);}
- | switchlist error {$$=$1;}
+ | error switchlist {$$=$2;}
;
included_entry : context_name { $$ = nword($1, &@1); }