Actions
Bug #10411
closedRipper.sexp("foo\n .bar") extract a wrong method name " .bar"
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-10-22 trunk 48083) [x86_64-linux]
Backport:
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]]]]]
Updated by nobu (Nobuyoshi Nakada) about 10 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]
Actions
Like0
Like0