Skip to content

Commit 00fb4d3

Browse files
committed
Ruby: Values in Hash literals and keyword arguments can be omitted
1 parent 3e2ca61 commit 00fb4d3

File tree

11 files changed

+182
-8
lines changed

11 files changed

+182
-8
lines changed

ruby/ql/lib/codeql/ruby/ast/Expr.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,16 @@ class Pair extends Expr, TPair {
293293
final Expr getKey() { toGenerated(result) = g.getKey() }
294294

295295
/**
296-
* Gets the value expression of this pair. For example, the `InteralLiteral`
296+
* Gets the value expression of this pair. For example, the `IntegerLiteral`
297297
* 123 in the following hash pair:
298298
* ```rb
299299
* { 'foo' => 123 }
300300
* ```
301301
*/
302-
final Expr getValue() { toGenerated(result) = g.getValue() }
302+
final Expr getValue() {
303+
toGenerated(result) = g.getValue() or
304+
synthChild(this, 0, result)
305+
}
303306

304307
final override string toString() { result = "Pair" }
305308

ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -975,24 +975,60 @@ private module ForLoopDesugar {
975975
* ```
976976
*/
977977
private module ImplicitHashValueSynthesis {
978-
private Ruby::AstNode keyWithoutValue(HashPattern parent, int i) {
978+
private Ruby::AstNode keyWithoutValue(AstNode parent, int i) {
979979
exists(Ruby::KeywordPattern pair |
980980
result = pair.getKey() and
981-
result = toGenerated(parent.getKey(i)) and
981+
result = toGenerated(parent.(HashPattern).getKey(i)) and
982+
not exists(pair.getValue())
983+
)
984+
or
985+
exists(Ruby::Pair pair |
986+
i = 0 and
987+
result = pair.getKey() and
988+
pair = toGenerated(parent) and
982989
not exists(pair.getValue())
983990
)
984991
}
985992

993+
private string keyName(Ruby::AstNode key) {
994+
result = key.(Ruby::String).getChild(0).(Ruby::StringContent).getValue() or
995+
result = key.(Ruby::HashKeySymbol).getValue()
996+
}
997+
986998
private class ImplicitHashValueSynthesis extends Synthesis {
987999
final override predicate child(AstNode parent, int i, Child child) {
988-
exists(TVariableReal variable |
989-
access(keyWithoutValue(parent, i), variable) and
990-
child = SynthChild(LocalVariableAccessRealKind(variable))
1000+
exists(Ruby::AstNode key | key = keyWithoutValue(parent, i) |
1001+
exists(TVariableReal variable |
1002+
access(key, variable) and
1003+
child = SynthChild(LocalVariableAccessRealKind(variable))
1004+
)
1005+
or
1006+
not access(key, _) and
1007+
exists(string name | name = keyName(key) |
1008+
child = SynthChild(ConstantReadAccessKind(name)) or
1009+
child = SynthChild(MethodCallKind(name, false, 0))
1010+
)
9911011
)
9921012
}
9931013

1014+
final override predicate methodCall(string name, boolean setter, int arity) {
1015+
setter = false and
1016+
arity = 0 and
1017+
name = keyName(keyWithoutValue(_, _)) and
1018+
not name.charAt(0).isUppercase()
1019+
}
1020+
1021+
final override predicate constantReadAccess(string name) {
1022+
name = keyName(keyWithoutValue(_, _)) and
1023+
name.charAt(0).isUppercase()
1024+
}
1025+
9941026
final override predicate location(AstNode n, Location l) {
995-
exists(HashPattern p, int i | n = p.getValue(i) and l = keyWithoutValue(p, i).getLocation())
1027+
exists(AstNode p, int i | l = keyWithoutValue(p, i).getLocation() |
1028+
n = p.(HashPattern).getValue(i)
1029+
or
1030+
i = 0 and n = p.(Pair).getValue()
1031+
)
9961032
}
9971033
}
9981034
}

ruby/ql/lib/codeql/ruby/ast/internal/Variable.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ private string variableNameInScope(Ruby::AstNode i, Scope::Range scope) {
116116
result = i.(Ruby::String).getChild(0).(Ruby::StringContent).getValue() or
117117
result = i.(Ruby::HashKeySymbol).getValue()
118118
)
119+
or
120+
exists(Ruby::Pair p | i = p.getKey() and not exists(p.getValue()) |
121+
result = i.(Ruby::String).getChild(0).(Ruby::StringContent).getValue() or
122+
result = i.(Ruby::HashKeySymbol).getValue()
123+
)
119124
)
120125
}
121126

ruby/ql/test/library-tests/ast/Ast.expected

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,29 @@ calls/calls.rb:
676676
# 341| getArgument: [LocalVariableAccess] x
677677
# 341| getArgument: [LocalVariableAccess] y
678678
# 341| getArgument: [LocalVariableAccess] z
679+
# 344| getStmt: [MethodCall] call to foo
680+
# 344| getReceiver: [Self, SelfVariableAccess] self
681+
# 344| getArgument: [Pair] Pair
682+
# 344| getKey: [SymbolLiteral] :x
683+
# 344| getValue: [IntegerLiteral] 42
684+
# 345| getStmt: [MethodCall] call to foo
685+
# 345| getReceiver: [Self, SelfVariableAccess] self
686+
# 345| getArgument: [Pair] Pair
687+
# 345| getKey: [SymbolLiteral] :x
688+
# 345| getValue: [LocalVariableAccess] x
689+
# 345| getArgument: [Pair] Pair
690+
# 345| getKey: [SymbolLiteral] :novar
691+
# 345| getValue: [MethodCall] call to novar
692+
# 346| getStmt: [MethodCall] call to foo
693+
# 346| getReceiver: [Self, SelfVariableAccess] self
694+
# 346| getArgument: [Pair] Pair
695+
# 346| getKey: [SymbolLiteral] :X
696+
# 346| getValue: [IntegerLiteral] 42
697+
# 347| getStmt: [MethodCall] call to foo
698+
# 347| getReceiver: [Self, SelfVariableAccess] self
699+
# 347| getArgument: [Pair] Pair
700+
# 347| getKey: [SymbolLiteral] :X
701+
# 347| getValue: [ConstantReadAccess] X
679702
control/cases.rb:
680703
# 1| [Toplevel] cases.rb
681704
# 2| getStmt: [AssignExpr] ... = ...
@@ -1963,6 +1986,23 @@ literals/literals.rb:
19631986
# 180| getComponent: [StringTextComponent]
19641987
# 180| cat file.txt
19651988
# 180|
1989+
# 184| getStmt: [AssignExpr] ... = ...
1990+
# 184| getAnOperand/getLeftOperand: [LocalVariableAccess] x
1991+
# 184| getAnOperand/getRightOperand: [IntegerLiteral] 42
1992+
# 185| getStmt: [HashLiteral] {...}
1993+
# 185| getElement: [Pair] Pair
1994+
# 185| getKey: [SymbolLiteral] :x
1995+
# 185| getValue: [LocalVariableAccess] x
1996+
# 185| getElement: [Pair] Pair
1997+
# 185| getKey: [SymbolLiteral] :y
1998+
# 185| getValue: [IntegerLiteral] 5
1999+
# 186| getStmt: [HashLiteral] {...}
2000+
# 186| getElement: [Pair] Pair
2001+
# 186| getKey: [SymbolLiteral] :y
2002+
# 186| getValue: [MethodCall] call to y
2003+
# 186| getElement: [Pair] Pair
2004+
# 186| getKey: [SymbolLiteral] :Z
2005+
# 186| getValue: [ConstantReadAccess] Z
19662006
control/loops.rb:
19672007
# 1| [Toplevel] loops.rb
19682008
# 2| getStmt: [AssignExpr] ... = ...

ruby/ql/test/library-tests/ast/AstDesugar.expected

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,24 @@ literals/literals.rb:
477477
# 118| getArgument: [HashSplatExpr] ** ...
478478
# 118| getAnOperand/getOperand/getReceiver: [MethodCall] call to baz
479479
# 118| getReceiver: [Self, SelfVariableAccess] self
480+
# 185| [HashLiteral] {...}
481+
# 185| getDesugared: [MethodCall] call to []
482+
# 185| getReceiver: [ConstantReadAccess] Hash
483+
# 185| getArgument: [Pair] Pair
484+
# 185| getKey: [SymbolLiteral] :x
485+
# 185| getValue: [LocalVariableAccess] x
486+
# 185| getArgument: [Pair] Pair
487+
# 185| getKey: [SymbolLiteral] :y
488+
# 185| getValue: [IntegerLiteral] 5
489+
# 186| [HashLiteral] {...}
490+
# 186| getDesugared: [MethodCall] call to []
491+
# 186| getReceiver: [ConstantReadAccess] Hash
492+
# 186| getArgument: [Pair] Pair
493+
# 186| getKey: [SymbolLiteral] :y
494+
# 186| getValue: [MethodCall] call to y
495+
# 186| getArgument: [Pair] Pair
496+
# 186| getKey: [SymbolLiteral] :Z
497+
# 186| getValue: [ConstantReadAccess] Z
480498
control/loops.rb:
481499
# 9| [ForExpr] for ... in ...
482500
# 9| getDesugared: [MethodCall] call to each

ruby/ql/test/library-tests/ast/ValueText.expected

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@
6565
| calls/calls.rb:340:27:340:27 | 4 | 4 |
6666
| calls/calls.rb:340:29:340:29 | 5 | 5 |
6767
| calls/calls.rb:340:31:340:31 | 6 | 6 |
68+
| calls/calls.rb:344:5:344:5 | :x | :x |
69+
| calls/calls.rb:344:8:344:9 | 42 | 42 |
70+
| calls/calls.rb:345:5:345:5 | :x | :x |
71+
| calls/calls.rb:345:9:345:13 | :novar | :novar |
72+
| calls/calls.rb:346:5:346:5 | :X | :X |
73+
| calls/calls.rb:346:8:346:9 | 42 | 42 |
74+
| calls/calls.rb:347:5:347:5 | :X | :X |
6875
| constants/constants.rb:3:19:3:27 | "const_a" | const_a |
6976
| constants/constants.rb:6:15:6:23 | "const_b" | const_b |
7077
| constants/constants.rb:17:12:17:18 | "Hello" | Hello |
@@ -572,6 +579,13 @@
572579
| literals/literals.rb:162:11:162:16 | <<-BLA | \nsome text\\nand some more\n |
573580
| literals/literals.rb:167:9:167:19 | <<~SQUIGGLY | \n indented stuff\n |
574581
| literals/literals.rb:180:10:180:19 | <<`SCRIPT` | \n cat file.txt\n |
582+
| literals/literals.rb:184:5:184:6 | 42 | 42 |
583+
| literals/literals.rb:185:2:185:2 | :x | :x |
584+
| literals/literals.rb:185:2:185:2 | x | 42 |
585+
| literals/literals.rb:185:6:185:6 | :y | :y |
586+
| literals/literals.rb:185:8:185:8 | 5 | 5 |
587+
| literals/literals.rb:186:2:186:2 | :y | :y |
588+
| literals/literals.rb:186:7:186:7 | :Z | :Z |
575589
| misc/misc.erb:2:15:2:37 | "main_include_admin.js" | main_include_admin.js |
576590
| misc/misc.rb:1:7:1:11 | "bar" | bar |
577591
| misc/misc.rb:3:7:3:9 | foo | foo |

ruby/ql/test/library-tests/ast/calls/arguments.expected

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ keywordArguments
1515
| calls.rb:249:15:249:30 | Pair | calls.rb:249:15:249:20 | call to foo | calls.rb:249:25:249:30 | call to bar |
1616
| calls.rb:278:5:278:13 | Pair | calls.rb:278:5:278:8 | :blah | calls.rb:278:11:278:13 | call to bar |
1717
| calls.rb:279:5:279:16 | Pair | calls.rb:279:5:279:8 | :blah | calls.rb:279:11:279:16 | call to bar |
18+
| calls.rb:344:5:344:9 | Pair | calls.rb:344:5:344:5 | :x | calls.rb:344:8:344:9 | 42 |
19+
| calls.rb:345:5:345:6 | Pair | calls.rb:345:5:345:5 | :x | calls.rb:345:5:345:5 | x |
20+
| calls.rb:345:9:345:14 | Pair | calls.rb:345:9:345:13 | :novar | calls.rb:345:9:345:13 | call to novar |
21+
| calls.rb:346:5:346:9 | Pair | calls.rb:346:5:346:5 | :X | calls.rb:346:8:346:9 | 42 |
22+
| calls.rb:347:5:347:6 | Pair | calls.rb:347:5:347:5 | :X | calls.rb:347:5:347:5 | X |
1823
keywordArgumentsByKeyword
1924
| calls.rb:278:1:278:14 | call to foo | blah | calls.rb:278:11:278:13 | call to bar |
2025
| calls.rb:279:1:279:17 | call to foo | blah | calls.rb:279:11:279:16 | call to bar |
26+
| calls.rb:344:1:344:10 | call to foo | x | calls.rb:344:8:344:9 | 42 |
27+
| calls.rb:345:1:345:15 | call to foo | novar | calls.rb:345:9:345:13 | call to novar |
28+
| calls.rb:345:1:345:15 | call to foo | x | calls.rb:345:5:345:5 | x |
29+
| calls.rb:346:1:346:10 | call to foo | X | calls.rb:346:8:346:9 | 42 |
30+
| calls.rb:347:1:347:7 | call to foo | X | calls.rb:347:5:347:5 | X |

ruby/ql/test/library-tests/ast/calls/calls.expected

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ callsWithNoReceiverArgumentsOrBlock
33
| calls.rb:286:5:286:9 | call to super | super |
44
| calls.rb:287:5:287:11 | call to super | super |
55
| calls.rb:305:5:305:9 | call to super | super |
6+
| calls.rb:345:9:345:13 | call to novar | novar |
67
callsWithArguments
78
| calls.rb:14:1:14:11 | call to foo | foo | 0 | calls.rb:14:5:14:5 | 0 |
89
| calls.rb:14:1:14:11 | call to foo | foo | 1 | calls.rb:14:8:14:8 | 1 |
@@ -107,6 +108,11 @@ callsWithArguments
107108
| calls.rb:341:3:341:13 | call to foo | foo | 0 | calls.rb:341:7:341:7 | x |
108109
| calls.rb:341:3:341:13 | call to foo | foo | 1 | calls.rb:341:10:341:10 | y |
109110
| calls.rb:341:3:341:13 | call to foo | foo | 2 | calls.rb:341:13:341:13 | z |
111+
| calls.rb:344:1:344:10 | call to foo | foo | 0 | calls.rb:344:5:344:9 | Pair |
112+
| calls.rb:345:1:345:15 | call to foo | foo | 0 | calls.rb:345:5:345:6 | Pair |
113+
| calls.rb:345:1:345:15 | call to foo | foo | 1 | calls.rb:345:9:345:14 | Pair |
114+
| calls.rb:346:1:346:10 | call to foo | foo | 0 | calls.rb:346:5:346:9 | Pair |
115+
| calls.rb:347:1:347:7 | call to foo | foo | 0 | calls.rb:347:5:347:6 | Pair |
110116
callsWithReceiver
111117
| calls.rb:2:1:2:5 | call to foo | calls.rb:2:1:2:5 | self |
112118
| calls.rb:5:1:5:10 | call to bar | calls.rb:5:1:5:3 | Foo |
@@ -358,6 +364,10 @@ callsWithReceiver
358364
| calls.rb:340:17:340:23 | call to [] | calls.rb:340:17:340:23 | Array |
359365
| calls.rb:340:26:340:32 | call to [] | calls.rb:340:26:340:32 | Array |
360366
| calls.rb:341:3:341:13 | call to foo | calls.rb:341:3:341:13 | self |
367+
| calls.rb:344:1:344:10 | call to foo | calls.rb:344:1:344:10 | self |
368+
| calls.rb:345:1:345:15 | call to foo | calls.rb:345:1:345:15 | self |
369+
| calls.rb:346:1:346:10 | call to foo | calls.rb:346:1:346:10 | self |
370+
| calls.rb:347:1:347:7 | call to foo | calls.rb:347:1:347:7 | self |
361371
callsWithBlock
362372
| calls.rb:17:1:17:17 | call to foo | calls.rb:17:5:17:17 | { ... } |
363373
| calls.rb:20:1:22:3 | call to foo | calls.rb:20:5:22:3 | do ... end |

ruby/ql/test/library-tests/ast/calls/calls.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,8 @@ def foo(a, b, ...)
340340
for x, y, z in [[1,2,3], [4,5,6]]
341341
foo x, y, z
342342
end
343+
344+
foo(x: 42)
345+
foo(x:, novar:)
346+
foo(X: 42)
347+
foo(X:)

ruby/ql/test/library-tests/ast/literals/literals.expected

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ allLiterals
217217
| literals.rb:171:9:171:15 | <<"DOC" | HereDoc | <none> |
218218
| literals.rb:176:9:176:15 | <<'DOC' | HereDoc | <none> |
219219
| literals.rb:180:10:180:19 | <<`SCRIPT` | HereDoc | \n cat file.txt\n |
220+
| literals.rb:184:5:184:6 | 42 | IntegerLiteral | 42 |
221+
| literals.rb:185:1:185:9 | {...} | HashLiteral | <none> |
222+
| literals.rb:185:2:185:2 | :x | SymbolLiteral | :x |
223+
| literals.rb:185:6:185:6 | :y | SymbolLiteral | :y |
224+
| literals.rb:185:8:185:8 | 5 | IntegerLiteral | 5 |
225+
| literals.rb:186:1:186:9 | {...} | HashLiteral | <none> |
226+
| literals.rb:186:2:186:2 | :y | SymbolLiteral | :y |
227+
| literals.rb:186:7:186:7 | :Z | SymbolLiteral | :Z |
220228
stringlikeLiterals
221229
| literals.rb:46:1:46:2 | "" | |
222230
| literals.rb:47:1:47:2 | "" | |
@@ -327,6 +335,10 @@ stringlikeLiterals
327335
| literals.rb:171:9:171:15 | <<"DOC" | <none> |
328336
| literals.rb:176:9:176:15 | <<'DOC' | <none> |
329337
| literals.rb:180:10:180:19 | <<`SCRIPT` | \n cat file.txt\n |
338+
| literals.rb:185:2:185:2 | :x | :x |
339+
| literals.rb:185:6:185:6 | :y | :y |
340+
| literals.rb:186:2:186:2 | :y | :y |
341+
| literals.rb:186:7:186:7 | :Z | :Z |
330342
stringLiterals
331343
| literals.rb:46:1:46:2 | "" | |
332344
| literals.rb:47:1:47:2 | "" | |
@@ -435,6 +447,10 @@ symbolLiterals
435447
| literals.rb:117:3:117:5 | :foo | :foo |
436448
| literals.rb:117:11:117:14 | :bar | :bar |
437449
| literals.rb:118:3:118:5 | :foo | :foo |
450+
| literals.rb:185:2:185:2 | :x | :x |
451+
| literals.rb:185:6:185:6 | :y | :y |
452+
| literals.rb:186:2:186:2 | :y | :y |
453+
| literals.rb:186:7:186:7 | :Z | :Z |
438454
subshellLiterals
439455
| literals.rb:130:1:130:7 | `ls -l` | ls -l |
440456
| literals.rb:131:1:131:9 | `ls -l` | ls -l |
@@ -701,19 +717,29 @@ hashLiterals
701717
| literals.rb:116:1:116:2 | {...} | 0 |
702718
| literals.rb:117:1:117:33 | {...} | 3 |
703719
| literals.rb:118:1:118:17 | {...} | 2 |
720+
| literals.rb:185:1:185:9 | {...} | 2 |
721+
| literals.rb:186:1:186:9 | {...} | 2 |
704722
hashLiteralElements
705723
| literals.rb:88:1:88:14 | {...} | 0 | literals.rb:88:3:88:12 | Pair | Pair |
706724
| literals.rb:117:1:117:33 | {...} | 0 | literals.rb:117:3:117:8 | Pair | Pair |
707725
| literals.rb:117:1:117:33 | {...} | 1 | literals.rb:117:11:117:19 | Pair | Pair |
708726
| literals.rb:117:1:117:33 | {...} | 2 | literals.rb:117:22:117:31 | Pair | Pair |
709727
| literals.rb:118:1:118:17 | {...} | 0 | literals.rb:118:3:118:8 | Pair | Pair |
710728
| literals.rb:118:1:118:17 | {...} | 1 | literals.rb:118:11:118:15 | ** ... | HashSplatExpr |
729+
| literals.rb:185:1:185:9 | {...} | 0 | literals.rb:185:2:185:3 | Pair | Pair |
730+
| literals.rb:185:1:185:9 | {...} | 1 | literals.rb:185:6:185:8 | Pair | Pair |
731+
| literals.rb:186:1:186:9 | {...} | 0 | literals.rb:186:2:186:3 | Pair | Pair |
732+
| literals.rb:186:1:186:9 | {...} | 1 | literals.rb:186:7:186:8 | Pair | Pair |
711733
hashLiteralKeyValuePairs
712734
| literals.rb:88:1:88:14 | {...} | literals.rb:88:3:88:12 | Pair | literals.rb:88:3:88:5 | :foo | literals.rb:88:8:88:12 | "bar" |
713735
| literals.rb:117:1:117:33 | {...} | literals.rb:117:3:117:8 | Pair | literals.rb:117:3:117:5 | :foo | literals.rb:117:8:117:8 | 1 |
714736
| literals.rb:117:1:117:33 | {...} | literals.rb:117:11:117:19 | Pair | literals.rb:117:11:117:14 | :bar | literals.rb:117:19:117:19 | 2 |
715737
| literals.rb:117:1:117:33 | {...} | literals.rb:117:22:117:31 | Pair | literals.rb:117:22:117:26 | "baz" | literals.rb:117:31:117:31 | 3 |
716738
| literals.rb:118:1:118:17 | {...} | literals.rb:118:3:118:8 | Pair | literals.rb:118:3:118:5 | :foo | literals.rb:118:8:118:8 | 7 |
739+
| literals.rb:185:1:185:9 | {...} | literals.rb:185:2:185:3 | Pair | literals.rb:185:2:185:2 | :x | literals.rb:185:2:185:2 | x |
740+
| literals.rb:185:1:185:9 | {...} | literals.rb:185:6:185:8 | Pair | literals.rb:185:6:185:6 | :y | literals.rb:185:8:185:8 | 5 |
741+
| literals.rb:186:1:186:9 | {...} | literals.rb:186:2:186:3 | Pair | literals.rb:186:2:186:2 | :y | literals.rb:186:2:186:2 | call to y |
742+
| literals.rb:186:1:186:9 | {...} | literals.rb:186:7:186:8 | Pair | literals.rb:186:7:186:7 | :Z | literals.rb:186:7:186:7 | Z |
717743
finiteRangeLiterals
718744
| literals.rb:121:2:121:6 | _ .. _ | literals.rb:121:2:121:2 | 1 | literals.rb:121:5:121:6 | 10 |
719745
| literals.rb:122:2:122:7 | _ ... _ | literals.rb:122:2:122:2 | 1 | literals.rb:122:6:122:7 | 10 |
@@ -802,6 +828,8 @@ numericLiterals
802828
| literals.rb:140:12:140:12 | 1 | IntegerLiteral | 1 |
803829
| literals.rb:146:10:146:10 | 1 | IntegerLiteral | 1 |
804830
| literals.rb:146:14:146:14 | 1 | IntegerLiteral | 1 |
831+
| literals.rb:184:5:184:6 | 42 | IntegerLiteral | 42 |
832+
| literals.rb:185:8:185:8 | 5 | IntegerLiteral | 5 |
805833
integerLiterals
806834
| literals.rb:10:1:10:4 | 1234 | IntegerLiteral | 1234 |
807835
| literals.rb:11:1:11:5 | 5_678 | IntegerLiteral | 5678 |
@@ -865,6 +893,8 @@ integerLiterals
865893
| literals.rb:140:12:140:12 | 1 | IntegerLiteral | 1 |
866894
| literals.rb:146:10:146:10 | 1 | IntegerLiteral | 1 |
867895
| literals.rb:146:14:146:14 | 1 | IntegerLiteral | 1 |
896+
| literals.rb:184:5:184:6 | 42 | IntegerLiteral | 42 |
897+
| literals.rb:185:8:185:8 | 5 | IntegerLiteral | 5 |
868898
floatLiterals
869899
| literals.rb:30:1:30:5 | 12.34 | FloatLiteral | 12.34 |
870900
| literals.rb:31:1:31:7 | 1234e-2 | FloatLiteral | 12.34 |

0 commit comments

Comments
 (0)