@@ -138,7 +138,7 @@ private module Cached {
138138 } or
139139 THashKeySymbolLiteral ( Generated:: HashKeySymbol g ) or
140140 THashLiteral ( Generated:: Hash g ) or
141- THashSplatArgument ( Generated:: HashSplatArgument g ) or
141+ THashSplatExpr ( Generated:: HashSplatArgument g ) or
142142 THashSplatParameter ( Generated:: HashSplatParameter g ) or
143143 THereDoc ( Generated:: HeredocBeginning g ) or
144144 TIdentifierMethodCall ( Generated:: Identifier g ) { isIdentifierMethodCall ( g ) } or
@@ -198,7 +198,10 @@ private module Cached {
198198 TParenthesizedExpr ( Generated:: ParenthesizedStatements g ) or
199199 TRShiftExprReal ( Generated:: Binary g ) { g instanceof @binary_ranglerangle } or
200200 TRShiftExprSynth ( AST:: AstNode parent , int i ) { mkSynthChild ( RShiftExprKind ( ) , parent , i ) } or
201- TRangeLiteral ( Generated:: Range g ) or
201+ TRangeLiteralReal ( Generated:: Range g ) or
202+ TRangeLiteralSynth ( AST:: AstNode parent , int i , boolean inclusive ) {
203+ mkSynthChild ( RangeLiteralKind ( inclusive ) , parent , i )
204+ } or
202205 TRationalLiteral ( Generated:: Rational g ) or
203206 TRedoStmt ( Generated:: Redo g ) or
204207 TRegexLiteral ( Generated:: Regex g ) or
@@ -232,7 +235,8 @@ private module Cached {
232235 TSingletonClass ( Generated:: SingletonClass g ) or
233236 TSingletonMethod ( Generated:: SingletonMethod g ) or
234237 TSpaceshipExpr ( Generated:: Binary g ) { g instanceof @binary_langleequalrangle } or
235- TSplatArgument ( Generated:: SplatArgument g ) or
238+ TSplatExprReal ( Generated:: SplatArgument g ) or
239+ TSplatExprSynth ( AST:: AstNode parent , int i ) { mkSynthChild ( SplatExprKind ( ) , parent , i ) } or
236240 TSplatParameter ( Generated:: SplatParameter g ) or
237241 TStmtSequenceSynth ( AST:: AstNode parent , int i ) { mkSynthChild ( StmtSequenceKind ( ) , parent , i ) } or
238242 TStringArrayLiteral ( Generated:: StringArray g ) or
@@ -337,7 +341,7 @@ private module Cached {
337341 n = TGlobalVariableAccessReal ( result , _) or
338342 n = THashKeySymbolLiteral ( result ) or
339343 n = THashLiteral ( result ) or
340- n = THashSplatArgument ( result ) or
344+ n = THashSplatExpr ( result ) or
341345 n = THashSplatParameter ( result ) or
342346 n = THereDoc ( result ) or
343347 n = TIdentifierMethodCall ( result ) or
@@ -367,7 +371,7 @@ private module Cached {
367371 n = TPair ( result ) or
368372 n = TParenthesizedExpr ( result ) or
369373 n = TRShiftExprReal ( result ) or
370- n = TRangeLiteral ( result ) or
374+ n = TRangeLiteralReal ( result ) or
371375 n = TRationalLiteral ( result ) or
372376 n = TRedoStmt ( result ) or
373377 n = TRegexLiteral ( result ) or
@@ -388,7 +392,7 @@ private module Cached {
388392 n = TSingletonClass ( result ) or
389393 n = TSingletonMethod ( result ) or
390394 n = TSpaceshipExpr ( result ) or
391- n = TSplatArgument ( result ) or
395+ n = TSplatExprReal ( result ) or
392396 n = TSplatParameter ( result ) or
393397 n = TStringArrayLiteral ( result ) or
394398 n = TStringConcatenation ( result ) or
@@ -458,10 +462,14 @@ private module Cached {
458462 or
459463 result = TMulExprSynth ( parent , i )
460464 or
465+ result = TRangeLiteralSynth ( parent , i , _)
466+ or
461467 result = TRShiftExprSynth ( parent , i )
462468 or
463469 result = TSelfSynth ( parent , i )
464470 or
471+ result = TSplatExprSynth ( parent , i )
472+ or
465473 result = TStmtSequenceSynth ( parent , i )
466474 or
467475 result = TSubExprSynth ( parent , i )
@@ -493,18 +501,11 @@ private module Cached {
493501 )
494502 }
495503
496- private Location synthLocation ( AST:: AstNode n ) {
497- exists ( Synthesis s , AST:: AstNode parent , int i |
498- s .child ( parent , i , _, SomeLocation ( result ) ) and
499- n = getSynthChild ( parent , i )
500- )
501- }
502-
503504 cached
504505 Location getLocation ( AST:: AstNode n ) {
505- result = synthLocation ( n )
506+ synthLocation ( n , result )
506507 or
507- not exists ( synthLocation ( n ) ) and
508+ not synthLocation ( n , _ ) and
508509 result = toGeneratedInclSynth ( n ) .getLocation ( )
509510 }
510511}
@@ -538,9 +539,10 @@ class TSelf = TSelfReal or TSelfSynth;
538539
539540class TExpr =
540541 TSelf or TArgumentList or TRescueClause or TRescueModifierExpr or TPair or TStringConcatenation or
541- TCall or TBlockArgument or TSplatArgument or THashSplatArgument or TConstantAccess or
542- TControlExpr or TWhenExpr or TLiteral or TCallable or TVariableAccess or TStmtSequence or
543- TOperation or TSimpleParameter ;
542+ TCall or TBlockArgument or TConstantAccess or TControlExpr or TWhenExpr or TLiteral or
543+ TCallable or TVariableAccess or TStmtSequence or TOperation or TSimpleParameter ;
544+
545+ class TSplatExpr = TSplatExprReal or TSplatExprSynth ;
544546
545547class TStmtSequence =
546548 TBeginBlock or TEndBlock or TThen or TElse or TDo or TEnsure or TStringInterpolationComponent or
@@ -586,7 +588,7 @@ class TOperation = TUnaryOperation or TBinaryOperation or TAssignment;
586588
587589class TUnaryOperation =
588590 TUnaryLogicalOperation or TUnaryArithmeticOperation or TUnaryBitwiseOperation or TDefinedExpr or
589- TSplatArgument or THashSplatArgument ;
591+ TSplatExpr or THashSplatExpr ;
590592
591593class TUnaryLogicalOperation = TNotExpr ;
592594
@@ -624,6 +626,8 @@ class TBinaryBitwiseOperation =
624626
625627class TLShiftExpr = TLShiftExprReal or TLShiftExprSynth ;
626628
629+ class TRangeLiteral = TRangeLiteralReal or TRangeLiteralSynth ;
630+
627631class TRShiftExpr = TRShiftExprReal or TRShiftExprSynth ;
628632
629633class TBitwiseAndExpr = TBitwiseAndExprReal or TBitwiseAndExprSynth ;
0 commit comments