diff --git a/Makefile b/Makefile index 34bbd098..c7ab9577 100644 --- a/Makefile +++ b/Makefile @@ -727,6 +727,7 @@ test_mxqd_control: mx_util.o test_mxqd_control: mx_mysql.o test_mxqd_control: mxq_group.o test_mxqd_control: keywordset.o +test_mxqd_control: parser.tab.o test_mxqd_control: LDLIBS += $(LDLIBS_MYSQL) clean: CLEAN += test_mxqd_control 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; diff --git a/test_parser.c b/test_parser.c index b52dbaa6..7ff44a04 100644 --- a/test_parser.c +++ b/test_parser.c @@ -62,6 +62,10 @@ int main() { test_expression(tags, "(true | false) & false ", 0, 0); test_expression(tags, "(true | false) & ( false || false ) & true & x", 1, 0); + keywordset_add(tags, "test test_1"); + test_expression(tags, "test", 0, 1); + test_expression(tags, "test_1", 0, 1); + keywordset_free(tags); static char text[8001];