Skip to content

Builtin index by line number #9612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Builtin index by line number #9612

merged 2 commits into from
Jan 22, 2024

Conversation

nobu
Copy link
Member

@nobu nobu commented Jan 19, 2024

The order of iseq may differ from the order of tokens, typically while/until conditions are put after the body.

These orders can match by using line numbers as builtin-indexes, but at the same time, it introduces the restriction that multiple cexpr! and cstmt! cannot appear in the same line.

Another possible idea is to use RubyVM::AbstractSyntaxTree and node_id instead of ripper, with making BASERUBY 3.1 or later.

Separated from #9576

@nobu nobu requested review from ko1 and k0kubun January 19, 2024 10:39
nobu added 2 commits January 19, 2024 23:27
The order of iseq may differ from the order of tokens, typically
`while`/`until` conditions are put after the body.

These orders can match by using line numbers as builtin-indexes, but
at the same time, it introduces the restriction that multiple `cexpr!`
and `cstmt!` cannot appear in the same line.

Another possible idea is to use `RubyVM::AbstractSyntaxTree` and
`node_id` instead of ripper, with making BASERUBY 3.1 or later.
@nobu nobu force-pushed the builtin-index-by-lineno branch from 531966c to e12ab47 Compare January 19, 2024 14:27
@nobu nobu merged commit d940e3b into ruby:master Jan 22, 2024
@nobu nobu deleted the builtin-index-by-lineno branch January 22, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants