aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/ael/ael.y
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-26 16:34:02 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-26 16:34:02 +0000
commitff0fcde5c61c9f9cb0315bc47ecff200b27db505 (patch)
treedc877899b474ad3f4ddbffd50e855ff42867f1ab /pbx/ael/ael.y
parent237b86b3225b873b1fb4f3345e725cb71da5e566 (diff)
closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config,
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@87168 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/ael/ael.y')
-rw-r--r--pbx/ael/ael.y21
1 files changed, 9 insertions, 12 deletions
diff --git a/pbx/ael/ael.y b/pbx/ael/ael.y
index d54dc01ab..3ddcee8f0 100644
--- a/pbx/ael/ael.y
+++ b/pbx/ael/ael.y
@@ -80,7 +80,7 @@ static pval *update_last(pval *, YYLTYPE *);
%token KW_CONTEXT LC RC LP RP SEMI EQ COMMA COLON AMPER BAR AT
-%token KW_MACRO KW_GLOBALS KW_IGNOREPAT KW_SWITCH KW_IF KW_IFTIME KW_ELSE KW_RANDOM KW_ABSTRACT
+%token KW_MACRO KW_GLOBALS KW_IGNOREPAT KW_SWITCH KW_IF KW_IFTIME KW_ELSE KW_RANDOM KW_ABSTRACT KW_EXTEND
%token EXTENMARK KW_GOTO KW_JUMP KW_RETURN KW_BREAK KW_CONTINUE KW_REGEXTEN KW_HINT
%token KW_FOR KW_WHILE KW_CASE KW_PATTERN KW_DEFAULT KW_CATCH KW_SWITCHES KW_ESWITCHES
%token KW_INCLUDES
@@ -201,22 +201,19 @@ context_name : word { $$ = $1; }
;
context : opt_abstract KW_CONTEXT context_name LC elements RC {
- if (!$5) {
- ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Warning! The empty context %s will be IGNORED!\n",
- my_file, @4.first_line, @4.first_column, @4.last_column, $3 );
- $$ = 0;
- free($3);
- } else {
- $$ = npval2(PV_CONTEXT, &@1, &@6);
- $$->u1.str = $3;
- $$->u2.statements = $5;
- set_dads($$,$5);
- $$->u3.abstract = $1;} }
+ $$ = npval2(PV_CONTEXT, &@1, &@6);
+ $$->u1.str = $3;
+ $$->u2.statements = $5;
+ set_dads($$,$5);
+ $$->u3.abstract = $1;}
;
/* optional "abstract" keyword XXX there is no regression test for this */
opt_abstract: KW_ABSTRACT { $$ = 1; }
| /* nothing */ { $$ = 0; }
+ | KW_EXTEND { $$ = 2; }
+ | KW_EXTEND KW_ABSTRACT { $$=3; }
+ | KW_ABSTRACT KW_EXTEND { $$=3; }
;
macro : KW_MACRO word LP arglist RP LC macro_statements RC {