From d5a7881381080fa4953b24c069675ca435598b95 Mon Sep 17 00:00:00 2001 From: akuznetsov Date: Tue, 26 Sep 2023 15:57:53 +0400 Subject: add line numbers and test --- src/main/javassist/compiler/ast/IntConst.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/javassist/compiler/ast/IntConst.java') diff --git a/src/main/javassist/compiler/ast/IntConst.java b/src/main/javassist/compiler/ast/IntConst.java index 7040b0c9..8ffce479 100644 --- a/src/main/javassist/compiler/ast/IntConst.java +++ b/src/main/javassist/compiler/ast/IntConst.java @@ -28,7 +28,11 @@ public class IntConst extends ASTree { protected long value; protected int type; - public IntConst(long v, int tokenId) { value = v; type = tokenId; } + public IntConst(long v, int tokenId, int lineNumber) { + super(lineNumber); + value = v; + type = tokenId; + } public long get() { return value; } @@ -111,7 +115,7 @@ public class IntConst extends ASTree { return null; } - return new IntConst(newValue, newType); + return new IntConst(newValue, newType, right.getLineNumber()); } private DoubleConst compute0(int op, DoubleConst right) { @@ -138,6 +142,6 @@ public class IntConst extends ASTree { return null; } - return new DoubleConst(newValue, right.type); + return new DoubleConst(newValue, right.type, right.getLineNumber()); } } -- cgit v1.2.3