From: lempinen Date: Fri, 8 Feb 2013 12:35:45 +0000 (+0000) Subject: Unused index variable is no longer marked as invalid index. (fixes #4058) X-Git-Tag: simantics-1.10.1~46 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=97b347283e69501f24557e3411d0c51b2340d2fe;p=simantics%2Fsysdyn.git Unused index variable is no longer marked as invalid index. (fixes #4058) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26741 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java index 1fa72bfb..e186e3f1 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java @@ -415,18 +415,21 @@ public class ExpressionUtils { HashSet removes = new HashSet(); for(Token t : forIndices.keySet()) { - boolean isFound = false; +// boolean isFound = false; for(Token rt : errors.keySet()) { if(rt.image.equals(t.image)) { - isFound = true; +// isFound = true; // remove range token from invalid ranges removes.add(rt); } } - if(!isFound) { - SyntaxError error = new SyntaxError(t, "Invalid index"); - errors.put(t, error); - } +// Why would this be invalid if the index just is not used anywhere? +// {1+2 for i in range} + +// if(!isFound) { +// SyntaxError error = new SyntaxError(t, "Invalid index"); +// errors.put(t, error); +// } } for(Token t : removes)