aboutsummaryrefslogtreecommitdiffstats
path: root/ast_expr2.fl
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-24 02:51:47 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-24 02:51:47 +0000
commit8ee43b1f52914bab8d125c06d8f9b84c1852484a (patch)
tree72ed70e65dd669830763c64337b76850404fc7eb /ast_expr2.fl
parent3b5b886721393022109731c5c39fa0896c26aad4 (diff)
add conditional operator to expression parser, and various cleanups (bug #4459)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5997 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'ast_expr2.fl')
-rwxr-xr-xast_expr2.fl10
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);
}