Issue #13770 has been updated by nobu (Nobuyoshi Nakada).


duerst (Martin D羹rst) wrote:
> In the patch, I suggest adding something like
> 
> ```c
> if (rb_enc_islower(c, enc)) return FALSE;
> ```
> 
> immediately before or after
> 
> ```c
> if (rb_enc_isupper(c, enc)) return TRUE;
> ```

I changed these code as followings:

```c
    if (rb_enc_isalpha(c, enc)) {
        /* non-lower case alphabet should be upper/title case */
        if (!rb_enc_islower(c, enc)) return TRUE;
    }
```

----------------------------------------
Feature #13770: Can't create valid Cyrillic-named class/module
https://bugs.ruby-lang.org/issues/13770#change-66537

* Author: sb (Sergey Borodanov)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
Can't create a valid Cyrillic-named class. If I have a file **邾邽把.rb**:

~~~ ruby
# Content of 技我把.rb:

class 妙我把

  def 扭把我志快找扼找志抉志忘找抆
    "妤把我志快找, 妙我把!"
  end

end
~~~

and do in **bash**:

~~~
ruby 技我把.rb
~~~

I get the error (**SyntaxError**):

~~~
技我把.rb:1: class/module name must be CONSTANT
~~~

Same error with module creating and same behavior in **irb** (please, see attachment). At the same time Cyrillic-named constants and methods work fine.

It is expected that creating Cyrillic-named class/modules should work without error.

---Files--------------------------------
Screenshot from 2017-07-26 19-08-14.png (64.2 KB)


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