@@ -77,12 +77,12 @@ private int parseInteger(Ruby::Integer i) {
77
77
v = values .indexOf ( c .toLowerCase ( ) ) and
78
78
exp = str .replaceAll ( "_" , "" ) .length ( ) - index - 1
79
79
|
80
- v * values .length ( ) .pow ( exp )
80
+ v * values .length ( ) .pow ( exp ) . floor ( )
81
81
)
82
82
)
83
83
}
84
84
85
- private class RequiredIntegerConstantValue extends RequiredConstantValue {
85
+ private class RequiredIntegerLiteralConstantValue extends RequiredConstantValue {
86
86
override predicate requiredInt ( int i ) { i = any ( IntegerLiteral il ) .getValue ( ) }
87
87
}
88
88
@@ -277,7 +277,7 @@ private class FalseLiteral extends BooleanLiteral, TFalseLiteral {
277
277
final override predicate isFalse ( ) { any ( ) }
278
278
}
279
279
280
- private class RequiredStringConstantValue extends RequiredConstantValue {
280
+ private class RequiredEncodingLiteralConstantValue extends RequiredConstantValue {
281
281
override predicate requiredString ( string s ) { s = "UTF-8" }
282
282
}
283
283
@@ -293,7 +293,7 @@ class EncodingLiteral extends Literal, TEncoding {
293
293
override ConstantValue:: ConstantStringValue getConstantValue ( ) { result .isString ( "UTF-8" ) }
294
294
}
295
295
296
- private class RequiredIntegerConstantValue2 extends RequiredConstantValue {
296
+ private class RequiredLineLiteralConstantValue extends RequiredConstantValue {
297
297
override predicate requiredInt ( int i ) { i = any ( LineLiteral ll ) .getLocation ( ) .getStartLine ( ) }
298
298
}
299
299
@@ -310,7 +310,7 @@ class LineLiteral extends Literal, TLine {
310
310
}
311
311
}
312
312
313
- private class RequiredStringConstantValue2 extends RequiredConstantValue {
313
+ private class RequiredFileLiteralConstantValue extends RequiredConstantValue {
314
314
override predicate requiredString ( string s ) {
315
315
s = any ( FileLiteral fl ) .getLocation ( ) .getFile ( ) .getAbsolutePath ( )
316
316
}
@@ -346,7 +346,7 @@ class StringComponent extends AstNode, TStringComponent {
346
346
ConstantValue:: ConstantStringValue getConstantValue ( ) { none ( ) }
347
347
}
348
348
349
- private class RequiredStringConstantValue3 extends RequiredConstantValue {
349
+ private class RequiredStringTextComponentConstantValue extends RequiredConstantValue {
350
350
override predicate requiredString ( string s ) {
351
351
s = any ( Ruby:: Token t | exists ( TStringTextComponentNonRegexp ( t ) ) ) .getValue ( )
352
352
}
@@ -378,7 +378,7 @@ class StringTextComponent extends StringComponent, TStringTextComponentNonRegexp
378
378
final override string getAPrimaryQlClass ( ) { result = "StringTextComponent" }
379
379
}
380
380
381
- private class RequiredStringConstantValue4 extends RequiredConstantValue {
381
+ private class RequiredStringEscapeSequenceComponentConstantValue extends RequiredConstantValue {
382
382
override predicate requiredString ( string s ) {
383
383
s = any ( Ruby:: Token t | exists ( TStringEscapeSequenceComponentNonRegexp ( t ) ) ) .getValue ( )
384
384
}
@@ -450,7 +450,7 @@ private string getRegExpTextComponentValue(RegExpTextComponent c) {
450
450
)
451
451
}
452
452
453
- private class RequiredStringConstantValue5 extends RequiredConstantValue {
453
+ private class RequiredRegExpTextComponentConstantValue extends RequiredConstantValue {
454
454
override predicate requiredString ( string s ) { s = getRegExpTextComponentValue ( _) }
455
455
}
456
456
@@ -490,7 +490,7 @@ private string getRegExpEscapeSequenceComponentValue(RegExpEscapeSequenceCompone
490
490
)
491
491
}
492
492
493
- private class RequiredStringConstantValue6 extends RequiredConstantValue {
493
+ private class RequiredRegExpEscapeSequenceComponentConstantValue extends RequiredConstantValue {
494
494
override predicate requiredString ( string s ) { s = getRegExpEscapeSequenceComponentValue ( _) }
495
495
}
496
496
@@ -761,7 +761,7 @@ class SymbolLiteral extends StringlikeLiteral, TSymbolLiteral {
761
761
// Tree-sitter gives us value text including the colon, which we skip.
762
762
private string getSimpleSymbolValue ( Ruby:: SimpleSymbol ss ) { result = ss .getValue ( ) .suffix ( 1 ) }
763
763
764
- private class RequiredSymbolConstantValue extends RequiredConstantValue {
764
+ private class RequiredSimpleSymbolConstantValue extends RequiredConstantValue {
765
765
override predicate requiredSymbol ( string s ) { s = getSimpleSymbolValue ( _) }
766
766
}
767
767
@@ -795,7 +795,7 @@ private class BareSymbolLiteral extends ComplexSymbolLiteral, TBareSymbolLiteral
795
795
final override StringComponent getComponent ( int i ) { toGenerated ( result ) = g .getChild ( i ) }
796
796
}
797
797
798
- private class RequiredSymbolConstantValue2 extends RequiredConstantValue {
798
+ private class RequiredHashKeySymbolConstantValue extends RequiredConstantValue {
799
799
override predicate requiredSymbol ( string s ) { s = any ( Ruby:: HashKeySymbol h ) .getValue ( ) }
800
800
}
801
801
@@ -829,7 +829,7 @@ class SubshellLiteral extends StringlikeLiteral, TSubshellLiteral {
829
829
final override StringComponent getComponent ( int i ) { toGenerated ( result ) = g .getChild ( i ) }
830
830
}
831
831
832
- private class RequiredStringConstantValue7 extends RequiredConstantValue {
832
+ private class RequiredCharacterConstantValue extends RequiredConstantValue {
833
833
override predicate requiredString ( string s ) { s = any ( Ruby:: Character c ) .getValue ( ) }
834
834
}
835
835
@@ -1131,7 +1131,7 @@ private string getMethodName(MethodName::Token t) {
1131
1131
result = t .( Ruby:: Setter ) .getName ( ) .getValue ( ) + "="
1132
1132
}
1133
1133
1134
- private class RequiredStringConstantValue8 extends RequiredConstantValue {
1134
+ private class RequiredMethodNameConstantValue extends RequiredConstantValue {
1135
1135
override predicate requiredString ( string s ) { s = getMethodName ( _) }
1136
1136
}
1137
1137
0 commit comments