https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2016-08-18T06:00:02Z
Ruby Issue Tracking System
Ruby master - Feature #12686: Allowing a postposed rescue in a method argument
https://bugs.ruby-lang.org/issues/12686?journal_id=60187
2016-08-18T06:00:02Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul></ul><p>It sounds nothing wrong with it, to me.</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gh">diff --git i/parse.y w/parse.y
index 17f0f9c..7a14941 100644
</span><span class="gd">--- i/parse.y
</span><span class="gi">+++ w/parse.y
</span><span class="p">@@ -2659,7 +2659,7 @@</span> primary : literal
$<val>1 = cmdarg_stack;
CMDARG_SET(0);
}
<span class="gd">- expr {SET_LEX_STATE(EXPR_ENDARG);} rparen
</span><span class="gi">+ stmt {SET_LEX_STATE(EXPR_ENDARG);} rparen
</span> {
CMDARG_SET($<val>1);
/*%%%*/
<span class="gh">diff --git i/test/ruby/test_syntax.rb w/test/ruby/test_syntax.rb
index ce01358..9b5b9f1 100644
</span><span class="gd">--- i/test/ruby/test_syntax.rb
</span><span class="gi">+++ w/test/ruby/test_syntax.rb
</span><span class="p">@@ -827,6 +827,10 @@</span>
end
end
<span class="gi">+ def test_stmt_lparen_arg
+ assert_valid_syntax("foo (bar rescue nil)")
+ end
+
</span> private
def not_label(x) @result = x; @not_label ||= nil end
</code></pre>
Ruby master - Feature #12686: Allowing a postposed rescue in a method argument
https://bugs.ruby-lang.org/issues/12686?journal_id=60188
2016-08-18T06:22:13Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul></ul><p><a href="https://github.com/ruby/ruby/compare/trunk...nobu:feature/12686-lparen_arg-stmt" class="external">https://github.com/ruby/ruby/compare/trunk...nobu:feature/12686-lparen_arg-stmt</a></p>
Ruby master - Feature #12686: Allowing a postposed rescue in a method argument
https://bugs.ruby-lang.org/issues/12686?journal_id=60189
2016-08-18T08:10:26Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul></ul><p><code>tLPAREN_ARG</code> has been introduced at 1.7, I think we can clear up spaces and parentheses rules now.</p>
Ruby master - Feature #12686: Allowing a postposed rescue in a method argument
https://bugs.ruby-lang.org/issues/12686?journal_id=60200
2016-08-19T02:39:14Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset r55965.</p>
<hr>
<p>parse.y: lparen_arg statement</p>
<ul>
<li>parse.y (primary): allow parenthesised statement as a method<br>
argument. [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Allowing a postposed rescue in a method argument (Closed)" href="https://bugs.ruby-lang.org/issues/12686">#12686</a>]</li>
</ul>