def's return value causes errors
It seems 2.1 hase some trouble with the "do" keyword in combination with the private/public/protected keywords and the def's return value:
$ ruby --version
ruby 2.1.0dev (2013-11-23 trunk 43807) [x86_64-linux]
$ ruby works.rb
$ ruby works_not.rb
test.rb:5: syntax error, unexpected keyword_do_block, expecting keyword_end
test.rb:12: syntax error, unexpected keyword_end, expecting end-of-input
#1 Updated by nobu (Nobuyoshi Nakada) about 4 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r44449.
Benjamin, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
parse.y: save cmdarg_stack in local scope
- parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to isolate command argument state from outer scope. [Bug #9308]
#2 [ruby-core:59614] Updated by nobu (Nobuyoshi Nakada) about 4 years ago
- Priority changed from 5 to Normal
- Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1: REQUIRED
I set backport to 2.0 to REQUIRED, because this is an old issue but noone has never been hit.
For source-level compatibility, it's better that 2.0 also accepts this syntax.