Project

General

Profile

Bug #10411

Ripper.sexp("foo\n .bar") extract a wrong method name " .bar"

Added by akr (Akira Tanaka) almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-10-22 trunk 48083) [x86_64-linux]
[ruby-dev:48684]

Description

以下のように、ripper が、メソッド名として " .bar" などといった
空白やピリオドの入った文字列を取り出してくることがあります。

% ./ruby -v -rripper -e 'p Ripper.sexp("foo\n         .bar")'
ruby 2.2.0dev (2014-10-22 trunk 48083) [x86_64-linux]
[:program, [[:call, [:vcall, [:@ident, "foo", [1, 0]]], :".", [:@ident, "         .bar", [2, 0]]]]]

改行を入れなければ、"bar" という期待するメソッド名が取り出されます。

% ./ruby -rripper -e 'p Ripper.sexp("foo         .bar")'   
[:program, [[:call, [:vcall, [:@ident, "foo", [1, 0]]], :".", [:@ident, "bar", [1, 13]]]]]

Associated revisions

Revision 5940b1f6
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix fluent interface identifier

  • parse.y (parser_yylex): dispatch newline and space at fluent interface, so that the following identifier does not include the space. [ruby-dev:48684] [Bug #10411]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 48126
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix fluent interface identifier

  • parse.y (parser_yylex): dispatch newline and space at fluent interface, so that the following identifier does not include the space. [ruby-dev:48684] [Bug #10411]

Revision 48126
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix fluent interface identifier

  • parse.y (parser_yylex): dispatch newline and space at fluent interface, so that the following identifier does not include the space. [ruby-dev:48684] [Bug #10411]

Revision 48126
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix fluent interface identifier

  • parse.y (parser_yylex): dispatch newline and space at fluent interface, so that the following identifier does not include the space. [ruby-dev:48684] [Bug #10411]

Revision 48126
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix fluent interface identifier

  • parse.y (parser_yylex): dispatch newline and space at fluent interface, so that the following identifier does not include the space. [ruby-dev:48684] [Bug #10411]

Revision 48126
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix fluent interface identifier

  • parse.y (parser_yylex): dispatch newline and space at fluent interface, so that the following identifier does not include the space. [ruby-dev:48684] [Bug #10411]

Revision 48126
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix fluent interface identifier

  • parse.y (parser_yylex): dispatch newline and space at fluent interface, so that the following identifier does not include the space. [ruby-dev:48684] [Bug #10411]

History

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r48126.


parse.y: fix fluent interface identifier

  • parse.y (parser_yylex): dispatch newline and space at fluent interface, so that the following identifier does not include the space. [ruby-dev:48684] [Bug #10411]

Also available in: Atom PDF