From: spiketeika@... Date: 2018-11-01T04:31:50+00:00 Subject: [ruby-core:89669] [Ruby trunk Feature#14836] Method to return first/last lineno/column of Proc Issue #14836 has been updated by yui-knk (Kaneko Yuichiro). If you use location information of proc to get AST nodes, I feel adding class method to AST module which receives proc and return AST nodes directly is useful. What do you think about it? For example: ```ruby def a(&block) node = RubyVM::AST.of(block) p node p node.children p node.children.last.children end a do 1 + 2 "abc".upcase end ``` ```shell $ ./miniruby /tmp/of.rb # [[], nil, #] [#, #] ``` Ref: https://github.com/ruby/ruby/compare/trunk...yui-knk:feature/ast_of?expand=1 ---------------------------------------- Feature #14836: Method to return first/last lineno/column of Proc https://bugs.ruby-lang.org/issues/14836#change-74711 * Author: tagomoris (Satoshi TAGOMORI) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- As written in https://bugs.ruby-lang.org/issues/6012, we want to know column no of Proc location. In addition to it, I want to know the last_lineno and last_column. If we don't have these values, we cannot know whether the "a" in code below is defined in block, or not. ```ruby b1 = ->(){ foo() }; a = 1; b2 = ->(){ bar() } ``` -- https://bugs.ruby-lang.org/ Unsubscribe: