]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Unused index variable is no longer marked as invalid index. (fixes #4058)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 8 Feb 2013 12:35:45 +0000 (12:35 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 8 Feb 2013 12:35:45 +0000 (12:35 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26741 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java

index 1fa72bfb965cce51d6368bfc3cb165b087f28e8d..e186e3f1aa5960f351dd93e5a48f27510c3eb6df 100644 (file)
@@ -415,18 +415,21 @@ public class ExpressionUtils {
 \r
         HashSet<Token> removes = new HashSet<Token>();\r
         for(Token t : forIndices.keySet()) {\r
-            boolean isFound = false;\r
+//            boolean isFound = false;\r
             for(Token rt : errors.keySet()) {\r
                 if(rt.image.equals(t.image)) {\r
-                    isFound = true;\r
+//                    isFound = true;\r
                     // remove range token from invalid ranges\r
                     removes.add(rt);\r
                 }\r
             }\r
-            if(!isFound) {\r
-                SyntaxError error = new SyntaxError(t, "Invalid index");\r
-                errors.put(t, error);\r
-            }\r
+//            Why would this be invalid if the index just is not used anywhere?\r
+//            {1+2 for i in range} \r
+            \r
+//            if(!isFound) {\r
+//                SyntaxError error = new SyntaxError(t, "Invalid index"); \r
+//                errors.put(t, error);\r
+//            }\r
         }\r
         \r
         for(Token t : removes)\r