Actions
Bug #18884
closedparse.y: inconsistent parsing of "if" after "class"
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Description
There is a corner case where if
inconsistently causes a syntax error:
# syntax error, unexpected `if' modifier
class if 1; Object end::Object
end
compare the following:
# 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.
Updated by nobu (Nobuyoshi Nakada) over 2 years ago
- Status changed from Open to Closed
Applied in changeset git|685efac05983dee44ce2d96c24f2fcb96a0aebe2.
[Bug #18884] class
cannot be just followed by modifiers
Actions
Like0
Like0