diff options
author | yui-knk <spiketeika@gmail.com> | 2024-07-10 22:28:22 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2024-07-23 12:36:00 +0900 |
commit | f23485a8d693cb69fd7b84c1ab93cb4198ecfe4a (patch) | |
tree | 12b99fc07f809edbd9ac32f3951a07f46e30a8cd /NEWS.md | |
parent | 5617fec1f81d0f05563b70fd04e9494896f6abc7 (diff) | |
download | ruby-f23485a8d693cb69fd7b84c1ab93cb4198ecfe4a.tar.gz |
[Feature #20624] Enhance `RubyVM::AbstractSyntaxTree::Node#locations`
This commit introduce `RubyVM::AbstractSyntaxTree::Node#locations` method
and `RubyVM::AbstractSyntaxTree::Location` class.
Ruby AST node will hold multiple locations information.
`RubyVM::AbstractSyntaxTree::Node#locations` provides a way to access
these locations information.
`RubyVM::AbstractSyntaxTree::Location` is a class which holds these location information:
* `#first_lineno`
* `#first_column`
* `#last_lineno`
* `#last_column`
Diffstat (limited to 'NEWS.md')
-rw-r--r-- | NEWS.md | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -44,6 +44,12 @@ Note: We're only listing outstanding class updates. * Range#size now raises TypeError if the range is not iterable. [[Misc #18984]] +* RubyVM::AbstractSyntaxTree + + * Add `RubyVM::AbstractSyntaxTree::Node#locations` method which returns location objects + associated with the AST node. [[Feature #20624]] + * Add `RubyVM::AbstractSyntaxTree::Location` class which holds location information. [[Feature #20624]] + ## Stdlib updates * Tempfile @@ -160,3 +166,4 @@ See GitHub releases like [GitHub Releases of Logger](https://github.com/ruby/log [Feature #20429]: https://bugs.ruby-lang.org/issues/20429 [Feature #20443]: https://bugs.ruby-lang.org/issues/20443 [Feature #20497]: https://bugs.ruby-lang.org/issues/20497 +[Feature #20624]: https://bugs.ruby-lang.org/issues/20624 |