[gtk/matthiasc/glshader-node] gsk: Make uniform regex more forgiving
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/glshader-node] gsk: Make uniform regex more forgiving
- Date: Wed, 23 Sep 2020 22:06:55 +0000 (UTC)
commit a0bc9d65da354070685052dcace058699cbc7d22
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Sep 23 18:03:52 2020 -0400
gsk: Make uniform regex more forgiving
Accept - in initializers, otherwise we don't accept
things like uniform int n = -2;
gsk/gskglshader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gsk/gskglshader.c b/gsk/gskglshader.c
index 38f2205218..281e3b67b8 100644
--- a/gsk/gskglshader.c
+++ b/gsk/gskglshader.c
@@ -392,7 +392,7 @@ gsk_gl_shader_constructed (GObject *object)
#define OPT_SPACE_RE "[ \\t]*"
#define UNIFORM_TYPE_RE "(int|uint|bool|float|vec2|vec3|vec4|sampler2D)"
#define UNIFORM_NAME_RE "([\\w]+)"
-#define OPT_INIT_VALUE_RE "[\\w(),. ]+" // This is a bit simple, but will match most initializers
+#define OPT_INIT_VALUE_RE "[-\\w(),. ]+" // This is a bit simple, but will match most initializers
#define OPT_COMMENT_RE "(//.*)?"
#define OPT_INITIALIZER_RE "(" OPT_SPACE_RE "=" OPT_SPACE_RE OPT_INIT_VALUE_RE ")?"
#define UNIFORM_MATCHER_RE "^uniform" SPACE_RE UNIFORM_TYPE_RE SPACE_RE UNIFORM_NAME_RE OPT_INITIALIZER_RE
OPT_SPACE_RE ";" OPT_SPACE_RE OPT_COMMENT_RE "$"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]