X-Git-Url: https://jxself.org/git/?p=carl9170fw.git;a=blobdiff_plain;f=config%2Fzconf.l;h=d0f5b132a9b39802680a3f07343d0c36bf83e4ee;hp=3c3f52a7537e1f51841bb92c82cbdfe8239c8607;hb=dd88a7e5b482637a26c67ffa1cdf7ebed204161d;hpb=bd5e9f6c34b6396318f6214c60cc827290830e5f diff --git a/config/zconf.l b/config/zconf.l index 3c3f52a..d0f5b13 100644 --- a/config/zconf.l +++ b/config/zconf.l @@ -1,12 +1,13 @@ %option nostdinit noyywrap never-interactive full ecs %option 8bit nodefault yylineno -%x COMMAND HELP STRING PARAM +%x COMMAND HELP STRING PARAM ASSIGN_VAL %{ /* * Copyright (C) 2002 Roman Zippel * Released under the terms of the GNU GPL v2.0. */ +#include #include #include #include @@ -102,17 +103,20 @@ n [A-Za-z0-9_-] { {n}+ { const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); - BEGIN(PARAM); current_pos.file = current_file; current_pos.lineno = yylineno; if (id && id->flags & TF_COMMAND) { + BEGIN(PARAM); yylval.id = id; return id->token; } alloc_string(yytext, yyleng); yylval.string = text; - return T_WORD; + return T_VARIABLE; } + "=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_RECURSIVE; return T_ASSIGN; } + ":=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_SIMPLE; return T_ASSIGN; } + [[:blank:]]+ . warn_ignored_character(*yytext); \n { BEGIN(INITIAL); @@ -120,6 +124,16 @@ n [A-Za-z0-9_-] } } +{ + [^[:blank:]\n]+.* { + alloc_string(yytext, yyleng); + yylval.string = text; + return T_ASSIGN_VAL; + } + \n { BEGIN(INITIAL); return T_EOL; } + . +} + { "&&" return T_AND; "||" return T_OR;