diff options
author | yui-knk <spiketeika@gmail.com> | 2022-10-01 17:44:28 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2022-10-08 17:59:11 +0900 |
commit | 4bfdf6d06ddbcf21345461038f2a9e3012f77268 (patch) | |
tree | c218b83b15c56b3a3727c5bd6a2d399564f01349 /ast.c | |
parent | 4f24f3ea94e43d1021fdd8548480f130f5112b99 (diff) |
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]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6512
Diffstat (limited to 'ast.c')
-rw-r--r-- | ast.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -648,6 +648,8 @@ node_children(rb_ast_t *ast, const NODE *node) NEW_CHILD(ast, node->nd_pkwargs), kwrest); } + case NODE_ERROR: + return rb_ary_new_from_node_args(ast, 0); case NODE_ARGS_AUX: case NODE_LAST: break; |