Add line_count field to rb_ast_body_t #10655
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Aiming to improve maintainability and readability, this patch adds
int line_count
field torb_ast_body_t
structure.Instead, we no longer cast
script_lines
to Fixnum.Background
Ref #10618
In the PR above, we have decoupled IMEMO from
rb_ast_t
. This means we could lift the five-word restriction of the structure that forced us to unionizerb_ast_t *
andFIXNUM
in one field.Relating refactor
rb_ruby_ast_new()
functionAttention
I will remove a code that assigns -1 to line_count, in
rb_binding_add_dynavars()
of vm.c, because I don't think it is necessary.But I will make another PR for this so that we can atomically revert in case I was wrong (See the comment on the code)