Skip to content

Commit

Permalink
Merge pull request #145 from bazsi/filterx-allow-underscore-as-first-…
Browse files Browse the repository at this point in the history
…character-of-identifiers

cfg-lex.l: allow an underscore in identifier names
  • Loading branch information
alltilla authored Jun 7, 2024
2 parents 7755676 + 29d5716 commit 3356bdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cfg-lex.l
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ filterx_word [^ \#'"/\(\)\{\}\[\]\\;\r\n\t,|\.@:]
<INITIAL>({word}+(\.)?)*{word}+ { return cfg_lexer_map_word_to_token(yyextra, yylval, yylloc, yytext); }
/* and this is the version in filterx, which only allows "traditional" identifiers */
<filterx>[a-zA-Z][_a-zA-Z0-9]* { return cfg_lexer_map_word_to_token(yyextra, yylval, yylloc, yytext); }
<filterx>[_a-zA-Z][_a-zA-Z0-9]* { return cfg_lexer_map_word_to_token(yyextra, yylval, yylloc, yytext); }
<filterx>\$\{([^}]+)\} { yylval->cptr = strndup(yytext+2, strlen(yytext) - 3); return LL_MESSAGE_REF; }
<INITIAL>\, ;
Expand Down

0 comments on commit 3356bdd

Please sign in to comment.