From 0d7e847153ed5b6006b686085207527ff2f28853 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 16 Aug 2023 23:52:04 +0900 Subject: [PATCH] Consider the special node when printing Appreciation to the reporter, Huichiao Tsai . --- parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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