switch statement in one place
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@24423 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
30cebe45f2
commit
088b8e75cf
File diff suppressed because it is too large
Load Diff
|
@ -98,7 +98,7 @@ static pval *update_last(pval *, YYLTYPE *);
|
|||
%type <pval>macro_call
|
||||
%type <pval>target jumptarget
|
||||
%type <pval>statement
|
||||
%type <pval>switch_head
|
||||
%type <pval>switch_statement
|
||||
|
||||
%type <pval>if_like_head
|
||||
%type <pval>statements
|
||||
|
@ -162,7 +162,7 @@ static pval *update_last(pval *, YYLTYPE *);
|
|||
} includes includeslist switchlist eswitches switches
|
||||
macro_statement macro_statements case_statement case_statements
|
||||
eval_arglist application_call application_call_head
|
||||
macro_call target jumptarget statement switch_head
|
||||
macro_call target jumptarget statement switch_statement
|
||||
if_like_head statements extension
|
||||
ignorepat element elements arglist assignment
|
||||
global_statements globals macro context object objects
|
||||
|
@ -364,9 +364,10 @@ goto_word : word { $$ = $1;}
|
|||
free($3);}
|
||||
;
|
||||
|
||||
switch_head : KW_SWITCH test_expr LC {
|
||||
$$ = npval2(PV_SWITCH, &@1, &@3);
|
||||
$$->u1.str = $2; }
|
||||
switch_statement : KW_SWITCH test_expr LC case_statements RC {
|
||||
$$ = npval2(PV_SWITCH, &@1, &@5);
|
||||
$$->u1.str = $2;
|
||||
$$->u2.statements = $4;}
|
||||
;
|
||||
|
||||
/*
|
||||
|
@ -397,9 +398,7 @@ statement : LC statements RC {
|
|||
$$ = npval2(PV_WHILE, &@1, &@3);
|
||||
$$->u1.str = $2;
|
||||
$$->u2.statements = $3; }
|
||||
| switch_head case_statements RC {
|
||||
$$ = update_last($1, &@3);
|
||||
$$->u2.statements = $2;}
|
||||
| switch_statement { $$ = $1; }
|
||||
| AMPER macro_call SEMI {
|
||||
$$ = update_last($2, &@2); }
|
||||
| application_call SEMI {
|
||||
|
|
Reference in New Issue