From f23485a8d693cb69fd7b84c1ab93cb4198ecfe4a Mon Sep 17 00:00:00 2001 From: yui-knk Date: Wed, 10 Jul 2024 22:28:22 +0900 Subject: [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` --- NEWS.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'NEWS.md') diff --git a/NEWS.md b/NEWS.md index 6844332585..7819504947 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 -- cgit v1.2.3