[ruby-core:91727] [Ruby trunk Bug#15648] Ripper::SCANNER_EVENTS に ignored_sp が含まれていない

From: under_free_fall@...
Date: 2019-03-09 08:21:11 UTC
List: ruby-core #91727
Issue #15648 has been reported by freedom (takiguchi satoru).

----------------------------------------
Bug #15648: Ripper::SCANNER_EVENTS に ignored_sp が含まれていない
https://bugs.ruby-lang.org/issues/15648

* Author: freedom (takiguchi satoru)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-03-07 trunk 67190) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Ripper::Filterにて <<~ 形式のヒアドキュメント文字列を解析した際に ignored_sp イベントが実行されますが、Ripper::SCANNER_EVENTS には含まれていません

ruby -e "require 'ripper';p Ripper::SCANNER_EVENTS.grep(/ignore/)"
[:ignored_nl]

ruby -e 'require "ripper";class RipperT < Ripper::Filter;def on_default(event, tok, f);p event;end;end;str="<<~TEST\n  :test\nTEST";RipperT.new(str).parse'
:on_heredoc_beg
:on_nl
:on_ignored_sp
:on_tstring_content
:on_heredoc_end

リファレンスマニュアル の Ripper::Filter に
> Ruby プログラムを解析して、Ripper::SCANNER_EVENTS にあるスキャナ イベントを実行します。
と書かれているため、含まれているのが適当だと考えます



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next