[Mesa-dev] [PATCH shader-db 1/4] split-to-files.py: fix parsing when #version is not at the beginning (v2)

Marek Olšák maraeo at gmail.com
Thu Jun 30 15:03:23 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

v2: make the RE non-greedy (suggested by Ilia Mirkin)
---
 split-to-files.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/split-to-files.py b/split-to-files.py
index 721b2da..7e14d89 100755
--- a/split-to-files.py
+++ b/split-to-files.py
@@ -71,7 +71,7 @@ def write_shader_test(filename, shaders):
     min_version = 110
     for stage, num in shaders:
         shader = shaders[(stage, num)]
-        m = re.match(r"^#version (\d\d\d)", shader)
+        m = re.match(r".*?#version (\d\d\d)", shader, re.DOTALL)
         if m:
             version = int(m.group(1), 10)
             if version > min_version:
-- 
2.7.4



More information about the mesa-dev mailing list