Project

General

Profile

Actions

Bug #15648

closed

Ripper::SCANNER_EVENTS に ignored_sp が含まれていない

Added by freedom (free dom) about 5 years ago. Updated about 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-03-07 trunk 67190) [x86_64-linux]
[ruby-core:91727]

Description

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 にあるスキャナ イベントを実行します。

と書かれているため、含まれているのが適当だと考えます

Actions #1

Updated by freedom (free dom) about 5 years ago

  • Description updated (diff)
Actions #2

Updated by nobu (Nobuyoshi Nakada) about 5 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r67200.


Add ignored_sp event

  • ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer): add ignored_sp
    event which will be fired from Ripper::Lexer#on_heredoc_dedent
    method. [ruby-core:91727] [Bug #15648]
Actions #3

Updated by nobu (Nobuyoshi Nakada) about 5 years ago

  • Description updated (diff)
  • Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED

Updated by naruse (Yui NARUSE) about 5 years ago

  • Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r67208 merged revision(s) 67200.

Updated by nagachika (Tomoyuki Chikanaga) about 5 years ago

  • Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE to 2.4: REQUIRED, 2.5: DONE, 2.6: DONE

ruby_2_5 r67242 merged revision(s) 67200.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0