mailr10240 - /1.3/scripts/code_validator


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on January 15, 2010 - 15:35:
Author: bugman
Date: Fri Jan 15 15:35:22 2010
New Revision: 10240

URL: http://svn.gna.org/viewcvs/relax?rev=10240&view=rev
Log:
Bug fixes for the code validator script.

The 4 character spacing check was faulty.


Modified:
    1.3/scripts/code_validator

Modified: 1.3/scripts/code_validator
URL: 
http://svn.gna.org/viewcvs/relax/1.3/scripts/code_validator?rev=10240&r1=10239&r2=10240&view=diff
==============================================================================
--- 1.3/scripts/code_validator (original)
+++ 1.3/scripts/code_validator Fri Jan 15 15:35:22 2010
@@ -714,23 +714,22 @@
             if not row:
                 continue
 
-            # Skip the line if within an array and ']' is encountered.
-            skip = 0
+            # Count the '[' and ']' characters.
             for char in line:
-                if char == ']':
-                    in_array = in_array - 1
-                    skip = 1
-            if skip:
-                continue
-
-            # Determine if an array has been started.
-            for char in line:
+                # In.
                 if char == '[':
                     in_array = in_array + 1
 
+                # Out.
+                elif char == ']':
+                    in_array = in_array - 1
+
             # Go to the next line if still within an array.
-            if in_array:
-                continue
+            if in_array > 0:
+                continue
+            elif in_array < 0:
+                print("Bug detected at line %i.  Unpaired terminating ] 
encountered.")
+                in_array = 0
 
             # Loop over the characters of the line.
             for char in line:




Related Messages


Powered by MHonArc, Updated Fri Jan 15 15:40:02 2010