diff options
-rw-r--r-- | src/cli_def.l | 3 | ||||
-rw-r--r-- | src/cli_parse.y | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/cli_def.l b/src/cli_def.l index 804d142..ef5a278 100644 --- a/src/cli_def.l +++ b/src/cli_def.l @@ -258,6 +258,7 @@ RE_TYPE_NAME (txt|u32|ipv4|ipv4net|ipv6|ipv6net|bool|macaddr) RE_VAL_U32 [0-9]+ RE_VAL_BOOL (true|false) RE_VAL_TEXT [a-zA-Z]+ +RE_VAL_PRIORITY (PARENT|{RE_VAL_U32}) /* operators */ RE_OP_COND (==|!=|<|>|<=|>=|in) @@ -445,7 +446,7 @@ RE_ACT_FIELD (help|syntax|commit|delete|update|activate|create|begin|end|comp_he return VAR; } -<INITIAL,expression>{RE_VAL_TEXT} { return return_value(TEXT_TYPE); } +<INITIAL,expression>{RE_VAL_PRIORITY} { yy_cli_parse_lval.val.free_me = TRUE; yy_cli_parse_lval.val.val = strdup(yy_cli_def_text); return PRIORITY_VALUE;} <INITIAL,expression>{RE_VAL_U32} { return return_value(INT_TYPE); } <INITIAL,expression>{RE_IPV4} { return return_value(IPV4_TYPE); } <INITIAL,expression>{RE_IPV4NET} { return return_value(IPV4NET_TYPE); } diff --git a/src/cli_parse.y b/src/cli_parse.y index 0f32928..50b1313 100644 --- a/src/cli_parse.y +++ b/src/cli_parse.y @@ -43,6 +43,7 @@ static void cli_deferror(const char *); %token DUMMY %left SEMI %token <val>VALUE +%token <val>PRIORITY_VALUE %token <type>TYPE_DEF %token <strp>VAR %token <strp> STRING @@ -174,7 +175,7 @@ default_cause: DEFAULT STRING yy_cli_parse_error((const char *)"Bad default\n"); parse_defp->def_default = $2; } -priority_stmt: PRIORITY VALUE +priority_stmt: PRIORITY PRIORITY_VALUE { char *tmp = $2.val; long long int cval = 0; |