diff --git a/parse.y b/parse.y index c10dfe6..1c58e13 100644 --- a/parse.y +++ b/parse.y @@ -6923,6 +6923,7 @@ parser_yylex(struct parser_params *parser) tokfix(); if (toklen() == start) { yyerror("numeric literal without digits"); + return 0; } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 16, FALSE)); @@ -6947,6 +6948,7 @@ parser_yylex(struct parser_params *parser) tokfix(); if (toklen() == start) { yyerror("numeric literal without digits"); + return 0; } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 2, FALSE)); @@ -6971,6 +6973,7 @@ parser_yylex(struct parser_params *parser) tokfix(); if (toklen() == start) { yyerror("numeric literal without digits"); + return 0; } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE)); @@ -6985,6 +6988,7 @@ parser_yylex(struct parser_params *parser) c = nextc(); if (c == -1 || c == '_' || !ISDIGIT(c)) { yyerror("numeric literal without digits"); + return 0; } } if (c >= '0' && c <= '7') {