From 6079e9b428a4e47fd58831b9d946e6c2cf2fefbc Mon Sep 17 00:00:00 2001 From: Christoph Diehl <1614333+posidron@users.noreply.github.com> Date: Wed, 9 May 2018 17:48:44 +0200 Subject: [PATCH] Fix regex for parsing uniforms and attributes --- lib/make/webgl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/make/webgl.js b/lib/make/webgl.js index 3de3c61..9154731 100644 --- a/lib/make/webgl.js +++ b/lib/make/webgl.js @@ -59,7 +59,7 @@ class webgl extends make { static parseUniforms (shader) { let names = [] - let result = shader.match(/uniform .* (\w+)(?=;)/gm) + let result = shader.match(/uniform \w+ \w+(?=;)/gm) if (result) { result.forEach((v) => names.push(v.split(' ').pop())) } @@ -68,7 +68,7 @@ class webgl extends make { static parseAttributes (shader) { let names = [] - let result = shader.match(/attribute .* (\w+)(?=;)/gm) + let result = shader.match(/attribute \w+ \w+(?=;)/gm) if (result) { result.forEach((v) => names.push(v.split(' ').pop())) }