# \[Closed\] Ripper.sexp("foo\\n .bar") extract a wrong method name " .bar"

**URL:** <https://www.ruby-forum.com/t/closed-ripper-sexp-foo-n-bar-extract-a-wrong-method-name-bar/232732>\
**Category:** Development\
**Created:** [October 24, 2014, 3:50pm UTC](https://www.ruby-forum.com/t/closed-ripper-sexp-foo-n-bar-extract-a-wrong-method-name-bar/232732 "2014-10-24T15:50:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 24, 2014, 3:50pm UTC](https://www.ruby-forum.com/t/closed-ripper-sexp-foo-n-bar-extract-a-wrong-method-name-bar/232732/1 "2014-10-24T15:50:50Z")

</div>

Issue #10411 has been updated by Nobuyoshi N…

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]

* * *

Bug #10411: Ripper.sexp(“foo\n .bar”) extract a wrong method  
name " .bar"

> **[Bug #10411: Ripper.sexp("foo\\n .bar") extract a wrong method name " ...](https://bugs.ruby-lang.org/issues/10411#change-49630)**
>
> Redmine

- Author: Akira T.
- Status: Closed
- Priority: Normal
- Assignee:
- Category:
- Target version:
- ruby -v: ruby 2.2.0dev (2014-10-22 trunk 48083) [x86\_64-linux]
- Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN

* * *

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

```auto
% ./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” という期待するメソッド名が取り出されます。

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

```
