diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-06-24 02:51:47 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-06-24 02:51:47 +0000 |
commit | d8cea2c8d4f54b91deb0c4e0b2f82c8fb2853c9b (patch) | |
tree | 72ed70e65dd669830763c64337b76850404fc7eb /ast_expr2.fl | |
parent | 9f4ad3363d6989a4be25e68b8c218cb0866c8646 (diff) |
add conditional operator to expression parser, and various cleanups (bug #4459)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'ast_expr2.fl')
-rwxr-xr-x | ast_expr2.fl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ast_expr2.fl b/ast_expr2.fl index 55dffd5d8..86a16c3fa 100755 --- a/ast_expr2.fl +++ b/ast_expr2.fl @@ -67,7 +67,9 @@ struct parse_io \* { SET_COLUMNS; SET_STRING; return TOK_MULT;} \/ { SET_COLUMNS; SET_STRING; return TOK_DIV;} \% { SET_COLUMNS; SET_STRING; return TOK_MOD;} +\? { SET_COLUMNS; SET_STRING; return TOK_COND;} \: { SET_COLUMNS; SET_STRING; return TOK_COLON;} +\:\: { SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;} \( { SET_COLUMNS; SET_STRING; return TOK_LP;} \) { SET_COLUMNS; SET_STRING; return TOK_RP;} @@ -78,7 +80,7 @@ struct parse_io [0-9]+ { SET_COLUMNS; /* the original behavior of the expression parser was to bring in numbers as a numeric string */ SET_NUMERIC_STRING; return TOKEN;} -[a-zA-Z0-9,.?';{}\\_^%$#@!]+ {SET_COLUMNS; SET_STRING; return TOKEN;} +[a-zA-Z0-9,.';{}\\_^%$#@!]+ {SET_COLUMNS; SET_STRING; return TOKEN;} %% @@ -157,14 +159,16 @@ int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio ) spacebuf2[i++]='^'; spacebuf2[i]= 0; -#ifdef STANDALONE +#ifdef STANDALONE3 /* easier to read in the standalone version */ printf("ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n", s, parseio->string,spacebuf2); #else ast_log(LOG_WARNING,"ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n", s, parseio->string,spacebuf2); - ast_log(LOG_WARNING,"If you have questions, please refer to doc/README.variables2 in the asterisk source.\n"); +#endif +#ifndef STANDALONE + ast_log(LOG_WARNING,"If you have questions, please refer to doc/README.variables in the asterisk source.\n"); #endif return(0); } |