Issue #15764 has been updated by shevegen (Robert A. Heiler).


I am not sure this is a bug, though. If it is a valid Unicode token then it should
work, so the behaviour would seem correct to me. Actually sawa made a similar comment
on SO - he is very active on the ruby bug tracker here too. :-)

As to whether it is a feature or not, hmm - I guess it depends on the definition
of whitespace as far as Unicode is concerned (and then on ruby whether it agrees
with this definition). Perhaps Durst could comment as to whether he knows of any
unicode character(s) that should be treated as one that should not be allowed to
use for a variable (e. g. when ruby decided to treat it as whitespace).

I am, however had, not sure if this is anything that is really highly important -
the SO link shows someone just having fun, with the cryptically written "Hello
world". Are many people using non-ASCII Unicode in .rb files these days for real
work? I myself am way too oldschool to want to transition away from ASCII/ISO*
(in europe at the least).

----------------------------------------
Feature #15764: Whitespace and control characters should not be permitted in tokens
https://bugs.ruby-lang.org/issues/15764#change-77604

* Author: BatmanAoD (Kyle Strand)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
As of Ruby 2.5.1p57, it appears that all valid Unicode code-points above 128 are permitted in tokens. This includes whitespace and control characters.

This was demonstrated here: https://gist.github.com/qrohlf/7045823

I have attached the raw download from the above gist.

The issue has been discussed on StackOverflow: https://stackoverflow.com/q/34455427/1858225

I would say this is arguably a bug, but I am marking this ticket as a "feature" since the current behavior could be considered by-design.

---Files--------------------------------
helloworld.rb (543 Bytes)


-- 
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>