[Piglit] [v8 01/13] glapi: fix parsing of extensions containing string "EGL_"
Chad Versace
chad.versace at linux.intel.com
Wed Jul 31 14:39:43 PDT 2013
On 07/10/2013 01:24 AM, Topi Pohjolainen wrote:
> Category for 'EGLImageTargetTexture2DOES' becomes 'GL_OES_EGL_image'
> instead of 'GL_OES_Eimage'.
>
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
> glapi/parse_glspec.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/glapi/parse_glspec.py b/glapi/parse_glspec.py
> index 9919fce..1d7c5a4 100644
> --- a/glapi/parse_glspec.py
> +++ b/glapi/parse_glspec.py
> @@ -461,9 +461,9 @@ class Api(object):
> elif re.match(r'/\* OpenGL ES 3.0 \*/', line):
> category = 'GL_ES_VERSION_3_0'
> else:
> - m = re.match(r'/\* (GL_.*) \*/', line)
> + m = re.match(r'/\*( GL_.*) \*/', line)
> if m:
> - category = m.group(1).replace('GL_', '')
> + category = m.group(1).replace(' GL_', '')
>
> m = re.match(r'GL_APICALL', line)
> if m:
The code's intent is to replace only the first occurrence of 'GL_',
so let's explicitly do that rather than relying on clever pattern
matching.
> diff --git a/glapi/parse_glspec.py b/glapi/parse_glspec.py
> index 9919fce..1d7c5a4 100644
> --- a/glapi/parse_glspec.py
> +++ b/glapi/parse_glspec.py
> @@ -461,9 +461,9 @@ class Api(object):
> elif re.match(r'/\* OpenGL ES 3.0 \*/', line):
> category = 'GL_ES_VERSION_3_0'
> else:
> m = re.match(r'/\* (GL_.*) \*/', line)
> if m:
> - category = m.group(1).replace('GL_', '')
> + # Replace only first occurrence of 'GL_'.
> + category = m.group(1).replace('GL_', '', 1)
>
> m = re.match(r'GL_APICALL', line)
> if m:
More information about the Piglit
mailing list