Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
cfg-lex.l: drop the leading ignored characters from tokens
Browse files Browse the repository at this point in the history
The lexer drops whitespace and leading commas but they should not make it
into token values.

Signed-off-by: Balazs Scheidler <[email protected]>
  • Loading branch information
bazsi authored and MrAnno committed Jan 9, 2024
1 parent 08bc77e commit 1a5313b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cfg-lex.l
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ word [^ \#'"\(\)\{\}\[\]\\;\r\n\t,|\.@:]
else
g_string_append(yyextra->string_buffer, yytext);
}
<INITIAL,filterx>{white}+ ;
<INITIAL,filterx>{white}+ { g_string_truncate(yyextra->token_text, 0); }
<INITIAL,filterx>\.\. { return LL_DOTDOT; }
<INITIAL,filterx>\.\.\. { return LL_DOTDOTDOT; }
<INITIAL,filterx>=> { return LL_ARROW; }
Expand Down Expand Up @@ -333,7 +333,7 @@ word [^ \#'"\(\)\{\}\[\]\\;\r\n\t,|\.@:]
/* 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); }
<INITIAL>\, ;
<INITIAL>\, { g_string_truncate(yyextra->token_text, 0); }
<INITIAL,filterx>\" {
g_string_truncate(yyextra->string_buffer, 0);
Expand Down

0 comments on commit 1a5313b

Please sign in to comment.