diff --git a/ql/src/codeql_ruby/ast/internal/Literal.qll b/ql/src/codeql_ruby/ast/internal/Literal.qll index 4baf27e1627..e0e1284f4cd 100644 --- a/ql/src/codeql_ruby/ast/internal/Literal.qll +++ b/ql/src/codeql_ruby/ast/internal/Literal.qll @@ -44,10 +44,10 @@ module RationalLiteral { final override Generated::Rational generated; final override string getValueText() { - result = generated.getChild().(Generated::Token).getValue() + result = generated.getChild().(Generated::Token).getValue() + "r" } - final override string toString() { result = this.getValueText() + "r" } + final override string toString() { result = this.getValueText() } } } diff --git a/ql/test/library-tests/ast/literals/literals.expected b/ql/test/library-tests/ast/literals/literals.expected index 9a15510b0cb..ef964f60b5a 100644 --- a/ql/test/library-tests/ast/literals/literals.expected +++ b/ql/test/library-tests/ast/literals/literals.expected @@ -20,8 +20,8 @@ allLiterals | literals.rb:30:1:30:5 | 12.34 | FloatLiteral | 12.34 | | literals.rb:31:1:31:7 | 1234e-2 | FloatLiteral | 1234e-2 | | literals.rb:32:1:32:7 | 1.234E1 | FloatLiteral | 1.234E1 | -| literals.rb:35:1:35:3 | 23r | RationalLiteral | 23 | -| literals.rb:36:1:36:5 | 9.85r | RationalLiteral | 9.85 | +| literals.rb:35:1:35:3 | 23r | RationalLiteral | 23r | +| literals.rb:36:1:36:5 | 9.85r | RationalLiteral | 9.85r | | literals.rb:39:1:39:2 | 2i | ComplexLiteral | 2i | | literals.rb:46:1:46:2 | "" | StringLiteral | | | literals.rb:47:1:47:2 | "" | StringLiteral | | @@ -623,8 +623,8 @@ numericLiterals | literals.rb:30:1:30:5 | 12.34 | FloatLiteral | 12.34 | | literals.rb:31:1:31:7 | 1234e-2 | FloatLiteral | 1234e-2 | | literals.rb:32:1:32:7 | 1.234E1 | FloatLiteral | 1.234E1 | -| literals.rb:35:1:35:3 | 23r | RationalLiteral | 23 | -| literals.rb:36:1:36:5 | 9.85r | RationalLiteral | 9.85 | +| literals.rb:35:1:35:3 | 23r | RationalLiteral | 23r | +| literals.rb:36:1:36:5 | 9.85r | RationalLiteral | 9.85r | | literals.rb:39:1:39:2 | 2i | ComplexLiteral | 2i | | literals.rb:58:13:58:13 | 2 | IntegerLiteral | 2 | | literals.rb:58:17:58:17 | 2 | IntegerLiteral | 2 | @@ -740,7 +740,7 @@ floatLiterals | literals.rb:31:1:31:7 | 1234e-2 | FloatLiteral | 1234e-2 | | literals.rb:32:1:32:7 | 1.234E1 | FloatLiteral | 1.234E1 | rationalLiterals -| literals.rb:35:1:35:3 | 23r | RationalLiteral | 23 | -| literals.rb:36:1:36:5 | 9.85r | RationalLiteral | 9.85 | +| literals.rb:35:1:35:3 | 23r | RationalLiteral | 23r | +| literals.rb:36:1:36:5 | 9.85r | RationalLiteral | 9.85r | complexLiterals | literals.rb:39:1:39:2 | 2i | ComplexLiteral | 2i |