ruby-next-parser 3.1.0.1 → 3.1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2124,23 +2124,13 @@ opt_block_args_tail:
2124
2124
  {
2125
2125
  result = [ *val[0], val[1] ]
2126
2126
  }
2127
- | p_args_head tSTAR tIDENTIFIER
2127
+ | p_args_head p_rest
2128
2128
  {
2129
- match_rest = @builder.match_rest(val[1], val[2])
2130
- result = [ *val[0], match_rest ]
2131
- }
2132
- | p_args_head tSTAR tIDENTIFIER tCOMMA p_args_post
2133
- {
2134
- match_rest = @builder.match_rest(val[1], val[2])
2135
- result = [ *val[0], match_rest, *val[4] ]
2136
- }
2137
- | p_args_head tSTAR
2138
- {
2139
- result = [ *val[0], @builder.match_rest(val[1]) ]
2129
+ result = [ *val[0], val[1] ]
2140
2130
  }
2141
- | p_args_head tSTAR tCOMMA p_args_post
2131
+ | p_args_head p_rest tCOMMA p_args_post
2142
2132
  {
2143
- result = [ *val[0], @builder.match_rest(val[1]), *val[3] ]
2133
+ result = [ *val[0], val[1], *val[3] ]
2144
2134
  }
2145
2135
  | p_args_tail
2146
2136
 
@@ -2179,6 +2169,11 @@ opt_block_args_tail:
2179
2169
  {
2180
2170
  result = @builder.match_rest(val[0], val[1])
2181
2171
  }
2172
+ | tSTAR nonlocal_var
2173
+ {
2174
+ non_lvar = @builder.accessible(val[1])
2175
+ result = @builder.match_rest(val[0], non_lvar)
2176
+ }
2182
2177
  | tSTAR
2183
2178
  {
2184
2179
  result = @builder.match_rest(val[0])
@@ -2303,6 +2298,11 @@ opt_block_args_tail:
2303
2298
  {
2304
2299
  result = @builder.assignable(@builder.match_var(val[0]))
2305
2300
  }
2301
+ | nonlocal_var
2302
+ {
2303
+ non_lvar = @builder.accessible(val[0])
2304
+ result = @builder.assignable(@builder.match_var(non_lvar))
2305
+ }
2306
2306
 
2307
2307
  p_var_ref: tCARET tIDENTIFIER
2308
2308
  {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-next-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.1
4
+ version: 3.1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-30 00:00:00.000000000 Z
11
+ date: 2021-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser