X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=config%2Fzconf.l;h=5341e5431f3b22024865989a0bf565adb3b95ea9;hb=904e8e395f2f16f92e567e958ef676053b2af90a;hp=3d8d8619153c966458eaa44dcf9363a0a6448955;hpb=342b243d70ea8bd00733d288f08fa89cf44a2773;p=carl9170fw.git diff --git a/config/zconf.l b/config/zconf.l index 3d8d861..5341e54 100644 --- a/config/zconf.l +++ b/config/zconf.l @@ -25,6 +25,7 @@ static struct { int lineno; } current_pos; +static int prev_prev_token = T_EOL; static int prev_token = T_EOL; static char *text; static int text_size, text_asize; @@ -104,7 +105,6 @@ n [A-Za-z0-9_-] current_pos.lineno = yylineno; if (id && id->flags & TF_COMMAND) { BEGIN(PARAM); - yylval.id = id; return id->token; } alloc_string(yytext, yyleng); @@ -118,9 +118,9 @@ n [A-Za-z0-9_-] return T_WORD; free(yylval.string); } - "=" { BEGIN(ASSIGN_VAL); return T_EQUAL; } - ":=" { BEGIN(ASSIGN_VAL); return T_COLON_EQUAL; } - "+=" { BEGIN(ASSIGN_VAL); return T_PLUS_EQUAL; } + "=" return T_EQUAL; + ":=" return T_COLON_EQUAL; + "+=" return T_PLUS_EQUAL; [[:blank:]]+ . warn_ignored_character(*yytext); \n { @@ -163,7 +163,6 @@ n [A-Za-z0-9_-] {n}+ { const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); if (id && id->flags & TF_PARAM) { - yylval.id = id; return id->token; } alloc_string(yytext, yyleng); @@ -290,6 +289,11 @@ repeat: if ((prev_token == T_EOL || prev_token == T_HELPTEXT) && token == T_EOL) goto repeat; + if (prev_prev_token == T_EOL && prev_token == T_WORD && + (token == T_EQUAL || token == T_COLON_EQUAL || token == T_PLUS_EQUAL)) + BEGIN(ASSIGN_VAL); + + prev_prev_token = prev_token; prev_token = token; return token;