Add r suffix to RationalLiteral::getValueText()

This commit is contained in:
Nick Rolfe
2021-02-16 16:21:28 +00:00
parent cd38b980a8
commit 02f853b8fd
2 changed files with 8 additions and 8 deletions

View File

@@ -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() }
}
}

View File

@@ -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 |