Parse static array types in prototypes in gltxt.py
authorArnaud Vrac <rawoul@gmail.com>
Mon, 19 Dec 2011 01:39:41 +0000 (02:39 +0100)
committerArnaud Vrac <rawoul@gmail.com>
Mon, 19 Dec 2011 12:57:18 +0000 (13:57 +0100)
specs/scripts/gltxt.py

index 07b7046..08b6a57 100755 (executable)
@@ -198,6 +198,11 @@ class TxtParser(LineParser):
             assert type == 'Void'
             return ''
         name = self.tokens.pop(0)
+        if self.tokens[0] == '[':
+            self.tokens.pop(0)
+            n = int(self.tokens.pop(0))
+            assert self.tokens.pop(0) == ']'
+            type = 'Array(%s, %d)' % (type, n)
         return '(%s, "%s")' % (type, name)
 
     def parse_type(self):