From bdffa974937def0945d578c01b0122e6addba766 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 16 Dec 2021 14:32:02 +0100 Subject: [PATCH] parser.y: Allow '_' in identifier Allow identifier in expressions to contain an underliner. --- parser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser.y b/parser.y index ea40c871..835486cc 100644 --- a/parser.y +++ b/parser.y @@ -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;