Consider the special node when printing

Appreciation to the reporter, Huichiao Tsai <hctsai.cs10@nycu.edu.tw>.
This commit is contained in:
Nobuyoshi Nakada 2023-08-16 23:52:04 +09:00
parent 7d3634a121
commit 0d7e847153
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -1466,7 +1466,10 @@ static int looking_at_eol_p(struct parser_params *p);
%define parse.error verbose
%printer {
#ifndef RIPPER
if ($$) {
if ($$ == (NODE *)-1) {
rb_parser_printf(p, "NODE_SPECIAL");
}
else if ($$) {
rb_parser_printf(p, "%s", ruby_node_name(nd_type($$)));
}
#else