scripts: Extend scope of LaTeX handling
authorShannon McPherson <shannon@lunarg.com>
Mon, 29 Oct 2018 17:25:49 +0000 (11:25 -0600)
committerShannon McPherson <shannon@lunarg.com>
Tue, 30 Oct 2018 17:37:59 +0000 (11:37 -0600)
The 1.1.90 header introduced the use of "\textrm" in `vk.xml`, requiring
changes to `scripts/helper_file_generator.py`

Change-Id: I0ee5012611d95cfdd1715a4e870a3b2b4e7556ee

scripts/helper_file_generator.py

index c1b5176ffb136941288bd7502f21d251d12d74bf..f35ba405830a846ae8b87b7a5238510e45d6c34e 100644 (file)
@@ -281,9 +281,9 @@ class HelperFileOutputGenerator(OutputGenerator):
                 decoratedName = '{}/{}'.format(*match.group(2, 3))
         else:
             # Matches expressions similar to 'latexmath : [dataSize \over 4]'
-            match = re.match(r'latexmath\s*\:\s*\[\s*(\w+)\s*\\over\s*(\d+)\s*\]', source)
-            name = match.group(1)
-            decoratedName = '{}/{}'.format(*match.group(1, 2))
+            match = re.match(r'latexmath\s*\:\s*\[\s*(\\textrm\{)?(\w+)\}?\s*\\over\s*(\d+)\s*\]', source)
+            name = match.group(2)
+            decoratedName = '{}/{}'.format(*match.group(2, 3))
         return name, decoratedName
     #
     # Retrieve the value of the len tag
@@ -305,7 +305,7 @@ class HelperFileOutputGenerator(OutputGenerator):
             result = str(result).replace('::', '->')
         return result
     #
-    # Check if a structure is or contains a dispatchable (dispatchable = True) or 
+    # Check if a structure is or contains a dispatchable (dispatchable = True) or
     # non-dispatchable (dispatchable = False) handle
     def TypeContainsObjectHandle(self, handle_type, dispatchable):
         if dispatchable:
@@ -1240,4 +1240,3 @@ class HelperFileOutputGenerator(OutputGenerator):
             return self.GenerateTypeMapHelperHeader()
         else:
             return 'Bad Helper File Generator Option %s' % self.helper_file_type
-