mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
Merged revisions 87168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87168 | murf | 2007-10-26 10:34:02 -0600 (Fri, 26 Oct 2007) | 1 line 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: https://origsvn.digium.com/svn/asterisk/trunk@87187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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 KW_LOCAL
|
||||
@@ -202,22 +202,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 {
|
||||
|
Reference in New Issue
Block a user