@@ -5060,8 +5060,7 @@ def on_lparen(value)
5060
5060
# first, = value
5061
5061
#
5062
5062
class MAssign
5063
- # [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] the target of the multiple
5064
- # assignment
5063
+ # [Mlhs | MlhsParen] the target of the multiple assignment
5065
5064
attr_reader :target
5066
5065
5067
5066
# [untyped] the value being assigned
@@ -5096,10 +5095,7 @@ def to_json(*opts)
5096
5095
end
5097
5096
5098
5097
# :call-seq:
5099
- # on_massign: (
5100
- # (Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen) target,
5101
- # untyped value
5102
- # ) -> MAssign
5098
+ # on_massign: ((Mlhs | MlhsParen) target, untyped value) -> MAssign
5103
5099
def on_massign ( target , value )
5104
5100
comma_range = target . location . end_char ...value . location . start_char
5105
5101
target . comma = true if source [ comma_range ] . strip . start_with? ( ',' )
@@ -5286,53 +5282,12 @@ def on_mlhs_add(mlhs, part)
5286
5282
MLHS . new ( parts : mlhs . parts << part , location : location )
5287
5283
end
5288
5284
5289
- # MLHSAddPost represents adding another set of variables onto a list of
5290
- # assignments after a splat variable within a multiple assignment.
5291
- #
5292
- # left, *middle, right = values
5293
- #
5294
- class MLHSAddPost
5295
- # [MlhsAddStar] the value being starred
5296
- attr_reader :star
5297
-
5298
- # [Mlhs] the values after the star
5299
- attr_reader :mlhs
5300
-
5301
- # [Location] the location of this node
5302
- attr_reader :location
5303
-
5304
- def initialize ( star :, mlhs :, location :)
5305
- @star = star
5306
- @mlhs = mlhs
5307
- @location = location
5308
- end
5309
-
5310
- def pretty_print ( q )
5311
- q . group ( 2 , '(' , ')' ) do
5312
- q . text ( 'mlhs_add_post' )
5313
-
5314
- q . breakable
5315
- q . pp ( star )
5316
-
5317
- q . breakable
5318
- q . pp ( mlhs )
5319
- end
5320
- end
5321
-
5322
- def to_json ( *opts )
5323
- { type : :mlhs_add_post , star : star , mlhs : mlhs , loc : location } . to_json (
5324
- *opts
5325
- )
5326
- end
5327
- end
5328
-
5329
5285
# :call-seq:
5330
- # on_mlhs_add_post: (MLHS star, MLHS mlhs) -> MLHSAddPost
5331
- def on_mlhs_add_post ( star , mlhs )
5332
- MLHSAddPost . new (
5333
- star : star ,
5334
- mlhs : mlhs ,
5335
- location : star . location . to ( mlhs . location )
5286
+ # on_mlhs_add_post: (MLHS left, MLHS right) -> MLHS
5287
+ def on_mlhs_add_post ( left , right )
5288
+ MLHS . new (
5289
+ parts : left . parts + right . parts ,
5290
+ location : left . location . to ( right . location )
5336
5291
)
5337
5292
end
5338
5293
@@ -5364,8 +5319,7 @@ def on_mlhs_new
5364
5319
# (left, right) = value
5365
5320
#
5366
5321
class MLHSParen
5367
- # [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] the contents inside of the
5368
- # parentheses
5322
+ # [Mlhs | MlhsParen] the contents inside of the parentheses
5369
5323
attr_reader :contents
5370
5324
5371
5325
# [Location] the location of this node
@@ -5391,9 +5345,7 @@ def to_json(*opts)
5391
5345
end
5392
5346
5393
5347
# :call-seq:
5394
- # on_mlhs_paren: (
5395
- # (Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen) contents
5396
- # ) -> MLHSParen
5348
+ # on_mlhs_paren: ((Mlhs | MlhsParen) contents) -> MLHSParen
5397
5349
def on_mlhs_paren ( contents )
5398
5350
lparen = find_token ( LParen )
5399
5351
rparen = find_token ( RParen )
0 commit comments