fix parser bug for user variable
This commit is contained in:
@ -1465,10 +1465,15 @@ BEGIN(in_c_comment);
|
|||||||
/* skip '@' and quotes like '/"/` */
|
/* skip '@' and quotes like '/"/` */
|
||||||
node->str_value_ = parse_strdup(yytext + 1, p->malloc_pool_, &(node->str_len_));
|
node->str_value_ = parse_strdup(yytext + 1, p->malloc_pool_, &(node->str_len_));
|
||||||
if (NULL != node->str_value_
|
if (NULL != node->str_value_
|
||||||
|
&& node->str_len_ > 1
|
||||||
&& *(yytext + 1) == *(yytext + node->str_len_)
|
&& *(yytext + 1) == *(yytext + node->str_len_)
|
||||||
&& (*(yytext + 1) == '\'' || *(yytext + 1) == '\"' || *(yytext + 1) == '`')) {
|
&& (*(yytext + 1) == '\'' || *(yytext + 1) == '\"' || *(yytext + 1) == '`')) {
|
||||||
node->str_value_ += 1;
|
node->str_value_ += 1;
|
||||||
node->str_len_ -= 2;
|
node->str_len_ -= 2;
|
||||||
|
} else if (NULL != node->str_value_
|
||||||
|
&& (*(yytext + 1) == '\'' || *(yytext + 1) == '\"' || *(yytext + 1) == '`')) {
|
||||||
|
yyerror(yylloc, yyextra, "unterminated user variable name\n");
|
||||||
|
return PARSER_SYNTAX_ERROR;
|
||||||
}
|
}
|
||||||
check_value(node->str_value_);
|
check_value(node->str_value_);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user