From 4bfdf6d06ddbcf21345461038f2a9e3012f77268 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sat, 1 Oct 2022 17:44:28 +0900 Subject: 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] --- node.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'node.c') 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: -- cgit v1.2.1