Fix regex for parsing uniforms and attributes
This commit is contained in:
parent
a7ac3bc258
commit
6079e9b428
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ class webgl extends make {
|
||||||
|
|
||||||
static parseUniforms (shader) {
|
static parseUniforms (shader) {
|
||||||
let names = []
|
let names = []
|
||||||
let result = shader.match(/uniform .* (\w+)(?=;)/gm)
|
let result = shader.match(/uniform \w+ \w+(?=;)/gm)
|
||||||
if (result) {
|
if (result) {
|
||||||
result.forEach((v) => names.push(v.split(' ').pop()))
|
result.forEach((v) => names.push(v.split(' ').pop()))
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ class webgl extends make {
|
||||||
|
|
||||||
static parseAttributes (shader) {
|
static parseAttributes (shader) {
|
||||||
let names = []
|
let names = []
|
||||||
let result = shader.match(/attribute .* (\w+)(?=;)/gm)
|
let result = shader.match(/attribute \w+ \w+(?=;)/gm)
|
||||||
if (result) {
|
if (result) {
|
||||||
result.forEach((v) => names.push(v.split(' ').pop()))
|
result.forEach((v) => names.push(v.split(' ').pop()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue