X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=config%2Fzconf.y;h=ac5935c84b48a7699e2d69799d52f651718fec0f;hb=800db6e4d8853227062024e8d842f962924d39a6;hp=7333e8e143631f7eb80880bf8ad6baf196346f51;hpb=7df515c55fa329c32734a5f93d251170a33f07f5;p=carl9170fw.git diff --git a/config/zconf.y b/config/zconf.y index 7333e8e..ac5935c 100644 --- a/config/zconf.y +++ b/config/zconf.y @@ -70,6 +70,7 @@ static struct menu *current_menu, *current_entry; %token T_ALLNOCONFIG_Y %token T_BOOL %token T_CLOSE_PAREN +%token T_COLON_EQUAL %token T_DEFAULT %token T_DEFCONFIG_LIST %token T_DEF_BOOL @@ -79,11 +80,10 @@ static struct menu *current_menu, *current_entry; %token T_MODULES %token T_OPEN_PAREN %token T_OPTION +%token T_PLUS_EQUAL %token T_STRING %token T_TRISTATE %token T_EOL -%token T_VARIABLE -%token T_ASSIGN %token T_ASSIGN_VAL %left T_OR @@ -101,6 +101,7 @@ static struct menu *current_menu, *current_entry; %type end %type if_entry menu_entry choice_entry %type word_opt assign_val +%type assign_op %destructor { fprintf(stderr, "%s:%d: missing end statement for this entry\n", @@ -478,7 +479,13 @@ word_opt: /* empty */ { $$ = NULL; } /* assignment statement */ -assignment_stmt: T_VARIABLE T_ASSIGN assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); } +assignment_stmt: T_WORD assign_op assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); } + +assign_op: + T_EQUAL { $$ = VAR_RECURSIVE; } + | T_COLON_EQUAL { $$ = VAR_SIMPLE; } + | T_PLUS_EQUAL { $$ = VAR_APPEND; } +; assign_val: /* empty */ { $$ = xstrdup(""); };