[#109095] [Ruby master Misc#18888] Migrate ruby-lang.org mail services to Google Domains and Google Workspace — "shugo (Shugo Maeda)" <noreply@...>
Issue #18888 has been reported by shugo (Shugo Maeda).
16 messages
2022/06/30
[ruby-core:109078] [Ruby master Bug#18884] parse.y: inconsistent parsing of "if" after "class"
From:
"qnighy (Masaki Hara)" <noreply@...>
Date:
2022-06-28 03:54:49 UTC
List:
ruby-core #109078
Issue #18884 has been reported by qnighy (Masaki Hara). ---------------------------------------- Bug #18884: parse.y: inconsistent parsing of "if" after "class" https://bugs.ruby-lang.org/issues/18884 * Author: qnighy (Masaki Hara) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- There is a corner case where `if` inconsistently causes a syntax error: ```ruby # syntax error, unexpected `if' modifier class if 1; Object end::Object end ``` compare the following: ```ruby # Parses module if 1; Object end::Kernel end ``` We use `EXPR_CLASS` after the class keyword to temporarily disable heredocs as in `class <<self; end`. This state is expected to behave like EXPR_BEG in other cases but the above case fails to take it into account. -- 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>