diff options
author | akuznetsov <akuznetsov@tradingview.com> | 2023-09-26 15:57:53 +0400 |
---|---|---|
committer | akuznetsov <akuznetsov@tradingview.com> | 2023-10-04 14:06:05 +0400 |
commit | d5a7881381080fa4953b24c069675ca435598b95 (patch) | |
tree | 7a94b14981dde07f72068b1bb0704e7b4c2f3fc8 /src/main/javassist/compiler/ast/DoubleConst.java | |
parent | 700be6f6f9546e8af049b1a763ce27f1fde5955d (diff) | |
download | javassist-d5a7881381080fa4953b24c069675ca435598b95.tar.gz javassist-d5a7881381080fa4953b24c069675ca435598b95.zip |
add line numbers and test
Diffstat (limited to 'src/main/javassist/compiler/ast/DoubleConst.java')
-rw-r--r-- | src/main/javassist/compiler/ast/DoubleConst.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/javassist/compiler/ast/DoubleConst.java b/src/main/javassist/compiler/ast/DoubleConst.java index f8d0afde..d55821f0 100644 --- a/src/main/javassist/compiler/ast/DoubleConst.java +++ b/src/main/javassist/compiler/ast/DoubleConst.java @@ -28,7 +28,11 @@ public class DoubleConst extends ASTree { protected double value; protected int type; - public DoubleConst(double v, int tokenId) { value = v; type = tokenId; } + public DoubleConst(double v, int tokenId, int lineNumber) { + super(lineNumber); + value = v; + type = tokenId; + } public double get() { return value; } @@ -63,15 +67,15 @@ public class DoubleConst extends ASTree { else newType = TokenId.FloatConstant; - return compute(op, this.value, right.value, newType); + return compute(op, this.value, right.value, newType, getLineNumber()); } private DoubleConst compute0(int op, IntConst right) { - return compute(op, this.value, right.value, this.type); + return compute(op, this.value, right.value, this.type, getLineNumber()); } private static DoubleConst compute(int op, double value1, double value2, - int newType) + int newType, int lineNumber) { double newValue; switch (op) { @@ -94,6 +98,6 @@ public class DoubleConst extends ASTree { return null; } - return new DoubleConst(newValue, newType); + return new DoubleConst(newValue, newType, lineNumber); } } |