aboutsummaryrefslogtreecommitdiffstats
path: root/node.c
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2022-10-01 17:44:28 +0900
committerYuichiro Kaneko <spiketeika@gmail.com>2022-10-08 17:59:11 +0900
commit4bfdf6d06ddbcf21345461038f2a9e3012f77268 (patch)
treec218b83b15c56b3a3727c5bd6a2d399564f01349 /node.c
parent4f24f3ea94e43d1021fdd8548480f130f5112b99 (diff)
downloadruby-4bfdf6d06ddbcf21345461038f2a9e3012f77268.tar.gz
Move `error` from top_stmts and top_stmt to stmt
By this change, syntax error is recovered smaller units. In the case below, "DEFN :bar" is same level with "CLASS :Foo" now. ``` module Z class Foo foo. end def bar end end ``` [Feature #19013]
Diffstat (limited to 'node.c')
-rw-r--r--node.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/node.c b/node.c
index 483e7fa8fb..c7469151ec 100644
--- a/node.c
+++ b/node.c
@@ -1098,6 +1098,9 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
F_NODE(nd_pkwrestarg, "keyword rest argument");
}
return;
+ case NODE_ERROR:
+ ANN("Broken input recovered by Error Tolerant mode");
+ return;
case NODE_ARGS_AUX:
case NODE_LAST: