From: "brueckenschlaeger23 (Micha J)" Date: 2012-11-01T21:29:20+09:00 Subject: [ruby-core:48703] [ruby-trunk - Bug #7255][Open] Ripper inside class_eval ommits :string_content between new line and :string_embexpr Issue #7255 has been reported by brueckenschlaeger23 (Micha J). ---------------------------------------- Bug #7255: Ripper inside class_eval ommits :string_content between new line and :string_embexpr https://bugs.ruby-lang.org/issues/7255 Author: brueckenschlaeger23 (Micha J) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 1.9.3p286 See the following Code parsed by Ripper using content = 'class_eval <<-RUBY, __FILE__, __LINE__+1 def #{parent}contents(*args) "" end RUBY ' Ripper::SexpBuilder.new(content).parse The resulting sexp ommits truncates the first string_add to " \n" instead of " \n def " - - :string_literal - - :string_add - - :string_add - - :string_add - - :string_content - - :@tstring_content - " \n" - - 2 - 0 If you remove the empty line, it works fine and the " def " is part of the string. As well it works without any embed #{}. -- http://bugs.ruby-lang.org/