summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-16 23:52:04 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-16 23:52:04 +0900
commit0d7e847153ed5b6006b686085207527ff2f28853 (patch)
tree88a7ce42f7fd3c4341cdd3fb75e31c74262e3516 /parse.y
parent7d3634a121736eea1a43a332b9abd0540d3a6300 (diff)
Consider the special node when printing
Appreciation to the reporter, Huichiao Tsai <hctsai.cs10@nycu.edu.tw>.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index c1c8a7514b..d5942983ea 100644
--- a/parse.y
+++ b/parse.y
@@ -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