From aaa97e2e41c0aa17a6f99099dd39bb73a935fe02 Mon Sep 17 00:00:00 2001 From: L0P0P Date: Sat, 29 Jun 2024 09:54:08 +0200 Subject: Fixed some warnings --- src/ast/nodes/AssignmentNode.java | 4 +++- src/ast/nodes/CompForNode.java | 1 - src/ast/nodes/ExprListNode.java | 2 +- src/ast/nodes/TestlistCompNode.java | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ast/nodes/AssignmentNode.java b/src/ast/nodes/AssignmentNode.java index 35c47b3..74d7283 100644 --- a/src/ast/nodes/AssignmentNode.java +++ b/src/ast/nodes/AssignmentNode.java @@ -29,7 +29,9 @@ public class AssignmentNode implements Node { errors.addAll(rhr.checkSemantics(ST, _nesting)); int lsize = lhr.getSize(); - int rsize = rhr.getSize(); + + // FIXME: unused variable + // int rsize = rhr.getSize(); // if (lsize == rsize) { for (int i = 0; i < lsize; i++) { diff --git a/src/ast/nodes/CompForNode.java b/src/ast/nodes/CompForNode.java index d5c50d6..06c7aee 100644 --- a/src/ast/nodes/CompForNode.java +++ b/src/ast/nodes/CompForNode.java @@ -2,7 +2,6 @@ package ast.nodes; import ast.types.*; import java.util.ArrayList; -import java.util.Arrays; import semanticanalysis.SemanticError; import semanticanalysis.SymbolTable; diff --git a/src/ast/nodes/ExprListNode.java b/src/ast/nodes/ExprListNode.java index 800f4be..4760db8 100644 --- a/src/ast/nodes/ExprListNode.java +++ b/src/ast/nodes/ExprListNode.java @@ -18,7 +18,7 @@ public class ExprListNode implements Node { @Override public ArrayList checkSemantics(SymbolTable ST, int _nesting) { - ArrayList errors = new ArrayList(); + ArrayList errors = new ArrayList<>(); for (var expr : exprs) { errors.addAll(expr.checkSemantics(ST, _nesting)); diff --git a/src/ast/nodes/TestlistCompNode.java b/src/ast/nodes/TestlistCompNode.java index 244f4ef..cba056c 100644 --- a/src/ast/nodes/TestlistCompNode.java +++ b/src/ast/nodes/TestlistCompNode.java @@ -20,7 +20,7 @@ public class TestlistCompNode implements Node { @Override public ArrayList checkSemantics(SymbolTable ST, int _nesting) { - ArrayList errors = new ArrayList(); + ArrayList errors = new ArrayList<>(); if (comp != null) { // if comp is set, then we save the atom in the ST (we assume the first expr is -- cgit v1.2.3-18-g5258