Skip to content

Commit

Permalink
parser.y: Allow '_' in identifier
Browse files Browse the repository at this point in the history
Allow identifier in expressions to contain an underliner.
  • Loading branch information
donald committed Dec 16, 2021
1 parent 66d0562 commit bdffa97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, struct parser_context *ctx) {
if (isalpha (c))
{
size_t name_len = 1;
while(isalnum(ctx->input[ctx->pos+name_len]))
while(isalnum(ctx->input[ctx->pos+name_len]) || ctx->input[ctx->pos+name_len] == '_')
name_len++;
char *name=xstrndup(&ctx->input[ctx->pos], name_len);
ctx->pos += name_len;
Expand Down

0 comments on commit bdffa97

Please sign in to comment.