[#111472] [Ruby master Bug#19274] Error installing ruby 3.2.0 on RH 8 — "aalllop (Alberto Allegue) via ruby-core" <ruby-core@...>
Issue #19274 has been reported by aalllop (Alberto Allegue).
5 messages
2022/12/28
[#111508] Data support for versions before 3.2.0 — Eustáquio Rangel via ruby-core <ruby-core@...>
I was wondering that every piece of code (gems, etc) that use the new Data =
3 messages
2022/12/29
[ruby-core:111161] [Ruby master Bug#19175] Ripper does not recognize some pattern matching defining local variable
From:
"tompng (tomoya ishida)" <noreply@...>
Date:
2022-12-02 16:58:01 UTC
List:
ruby-core #111161
Issue #19175 has been reported by tompng (tomoya ishida).
----------------------------------------
Bug #19175: Ripper does not recognize some pattern matching defining local variable
https://bugs.ruby-lang.org/issues/19175
* Author: tompng (tomoya ishida)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Ripepr does not recognize hshptn and aryptn splat defining local variables.
~~~ruby
Ripper.sexp('a in [*x]; x')
# =>
[:program,
[[:case, [:vcall, [:@ident, "a", [1, 0]]], [:in, [:aryptn, nil, nil, [:var_field, [:@ident, "x", [1, 7]]], nil], nil, nil]],
[:vcall, [:@ident, "x", [1, 11]]]]]
Ripper.sexp('a in {x:}; x')
# =>
[:program,
[[:case, [:vcall, [:@ident, "a", [1, 0]]], [:in, [:hshptn, nil, [[[:@label, "x:", [1, 6]], nil]], nil], nil, nil]],
[:vcall, [:@ident, "x", [1, 11]]]]]
~~~
RubyVM::AbstractSyntaxTree returns `(LVAR@1:11-1:12 :x)`
I think `[:vcall, [:@ident, "x", [1, 11]]]` should be `[:var_ref, [:@ident, "x", [1, 11]]]`
Other pattern seems to be OK.
~~~ruby
Ripper.sexp('a in [x, y => z]; x; y; z')
# =>
[:program,
[[:case,
[:vcall, [:@ident, "a", [1, 0]]],
[:in,
[:aryptn,
nil,
[[:var_field, [:@ident, "x", [1, 6]]],
[:binary, [:var_field, [:@ident, "y", [1, 9]]], :"=>", [:var_field, [:@ident, "z", [1, 14]]]]],
nil,
nil],
nil,
nil]],
[:var_ref, [:@ident, "x", [1, 18]]],
[:var_ref, [:@ident, "y", [1, 21]]],
[:var_ref, [:@ident, "z", [1, 24]]]]]
~~~
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/