[ruby-core:81006] [Ruby trunk Bug#13536][Open] Ripper fails to tokenize nested squiggly heredoc

From: shyouhei@...
Date: 2017-05-05 09:19:35 UTC
List: ruby-core #81006
Issue #13536 has been updated by shyouhei (Shyouhei Urabe).

Status changed from Closed to Open

Thank you, the exception disappeared.

But it seems incomplete.  Look at this slightly different example:

```
require 'ripper'

str = \
<<~'end'
<<~"do"
#{
<<~"begin"
 this must be a valid ruby
begin
}
do
end
puts eval(str)
str == Ripper.tokenize(str).join
```

The last line does not raise exception, but evaluates false.

----------------------------------------
Bug #13536: Ripper fails to tokenize nested squiggly heredoc
https://bugs.ruby-lang.org/issues/13536#change-64665

* Author: shyouhei (Shyouhei Urabe)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.0dev (2017-05-02 trunk 58544) [x86_64-darwin15]
* Backport: 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED
----------------------------------------
```ruby
require 'ripper'

str = \
<<~'end'
<<~"do"
#{
<<~"begin"
this must be a valid ruby
begin
}
do
end
puts eval(str)
str == Ripper.tokenize(str)
```

This program fails at the last line.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next