You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make defined? (x;) return expression when using parse.y parser
Follow up [Bug #21029].
Currently, `defined? (x;)` returns `expression` when using Prism parser.
See:
- #12949
- https://bugs.ruby-lang.org/issues/21029
However, `defined? (x;)` returns nil when using parse.y, as reported in bug ticket comment and test-all (when using parse.y parser) test result.
This change adds a context flag to track trailing semicolons in defined? scope.
When a trailing semicolon is detected within a defined? scope, the generated AST node is wrapped with NODE_BLOCK.
This change ensures consistent behavior with `defined? (;x)` .
0 commit comments