From 97b347283e69501f24557e3411d0c51b2340d2fe Mon Sep 17 00:00:00 2001 From: lempinen Date: Fri, 8 Feb 2013 12:35:45 +0000 Subject: [PATCH] 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 --- .../sysdyn/ui/utils/ExpressionUtils.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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) -- 2.47.1