summaryrefslogtreecommitdiffstats
path: root/conf/confbase.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-05-06 22:00:54 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2011-05-06 22:00:54 +0200
commitb8cc390e7ed724a9ad605453227d1e4686f3a11b (patch)
tree9602fa14bd688c0cc62e4c18b660ae53efee4839 /conf/confbase.Y
parent409e8a6e21d3df0919fd2e131ba9a58222baee50 (diff)
downloadbird-b8cc390e7ed724a9ad605453227d1e4686f3a11b.tar
bird-b8cc390e7ed724a9ad605453227d1e4686f3a11b.zip
Fixes several problems in filter syntax.
- Fixes several conflicts in the grammar. - Fixes a bug in (a..b, c) pair patterns. - Makes pair patterns orthogonal. - Allows term expressions in pair patterns without additional ( ). - Allows several comma separated values in switch cases.
Diffstat (limited to 'conf/confbase.Y')
-rw-r--r--conf/confbase.Y13
1 files changed, 12 insertions, 1 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y
index 68960c2..499a770 100644
--- a/conf/confbase.Y
+++ b/conf/confbase.Y
@@ -24,6 +24,15 @@ CF_HDR
/* FIXME: Turn on YYERROR_VERBOSE and work around lots of bison bugs? */
+CF_DEFINES
+
+static void
+check_u16(unsigned val)
+{
+ if (val > 0xFFFF)
+ cf_error("Value %d out of range (0-65535)", val);
+}
+
CF_DECLS
%union {
@@ -48,7 +57,7 @@ CF_DECLS
struct timeformat *tf;
}
-%token END CLI_MARKER INVALID_TOKEN ELSECOL
+%token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT
%token GEQ LEQ NEQ AND OR
%token PO PC
%token <i> NUM ENUM
@@ -96,6 +105,8 @@ expr:
| SYM { if ($1->class != SYM_NUMBER) cf_error("Number expected"); else $$ = $1->aux; }
;
+/* expr_u16: expr { check_u16($1); $$ = $1; }; */
+
CF_ADDTO(conf, definition)
definition:
DEFINE SYM '=' expr ';' {