[ruby-core:76961] [Ruby trunk Feature#12686] Allowing a postposed rescue in a method argument
From:
nobu@...
Date:
2016-08-18 08:10:26 UTC
List:
ruby-core #76961
Issue #12686 has been updated by Nobuyoshi Nakada. `tLPAREN_ARG` has been introduced at 1.7, I think we can clear up spaces and parentheses rules now. ---------------------------------------- Feature #12686: Allowing a postposed rescue in a method argument https://bugs.ruby-lang.org/issues/12686#change-60189 * Author: Naotoshi Seo * Status: Open * Priority: Normal * Assignee: ---------------------------------------- On defining my own DSL, I wanted to write a code like: ``` foo (Integer(ENV['FOO']) rescue nil) ``` where `foo` is a method which receives one argument , but I got following error ``` SyntaxError: (irb):1: syntax error, unexpected modifier_rescue, expecting ')' ``` In contrast, following codes were valid: ``` foo ((Integer(ENV['FOO']) rescue nil)) ``` or ``` foo (begin; Integer(ENV['FOO']); rescue; nil; end) ``` This is a feature request to allow such a syntax, a postposed rescue in a method argument. -- 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>