X-Git-Url: https://jxself.org/git/?p=carl9170fw.git;a=blobdiff_plain;f=config%2Fzconf.l;h=289813deb8cb7775583236c612bc1e27e86f30b3;hp=62a0973bee034f4c4fd23bd16f2f1c131665fe3c;hb=470582e04372ab9d3079f0da8d6887d339b4a68b;hpb=c9645e9489aac917a4883ddecc857b1c6fcc2c38 diff --git a/config/zconf.l b/config/zconf.l index 62a0973..289813d 100644 --- a/config/zconf.l +++ b/config/zconf.l @@ -73,7 +73,7 @@ static void warn_ignored_character(char chr) { fprintf(stderr, "%s:%d:warning: ignoring unsupported character '%c'\n", - zconf_curname(), zconf_lineno(), chr); + current_file->name, yylineno, chr); } %} @@ -88,12 +88,6 @@ n [A-Za-z0-9_-] return T_EOL; } [ \t]*#.* - - -[ \t]+ { - BEGIN(COMMAND); -} - . { unput(yytext[0]); BEGIN(COMMAND); @@ -114,6 +108,13 @@ n [A-Za-z0-9_-] yylval.string = text; return T_VARIABLE; } + ({n}|$)+ { + /* this token includes at least one '$' */ + yylval.string = expand_token(yytext, yyleng); + if (strlen(yylval.string)) + return T_VARIABLE; + free(yylval.string); + } "=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_RECURSIVE; return T_ASSIGN; } ":=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_SIMPLE; return T_ASSIGN; } "+=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_APPEND; return T_ASSIGN; } @@ -214,6 +215,8 @@ n [A-Za-z0-9_-] } <> { BEGIN(INITIAL); + yylval.string = text; + return T_WORD_QUOTE; } }