Minor linter fixes
This commit is contained in:
parent
0e292b817c
commit
cf910de0f6
3 changed files with 13 additions and 9 deletions
|
@ -25,7 +25,7 @@ class logger {
|
||||||
}
|
}
|
||||||
if (typeof window === 'undefined') {
|
if (typeof window === 'undefined') {
|
||||||
try {
|
try {
|
||||||
print(msg) // eslint-disable-line no-undef
|
print(msg) // eslint-disable-line no-undef
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(msg)
|
console.log(msg)
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,8 @@ class text extends make {
|
||||||
|
|
||||||
static layoutCharCodes () {
|
static layoutCharCodes () {
|
||||||
return random.pick([
|
return random.pick([
|
||||||
0, // null
|
0, // null
|
||||||
160, // non-breaking space
|
160, // non-breaking space
|
||||||
0x005C, // backslash, but in some countries, represents local currency symbol (e.g. yen)
|
0x005C, // backslash, but in some countries, represents local currency symbol (e.g. yen)
|
||||||
0x00AD, // soft hyphen
|
0x00AD, // soft hyphen
|
||||||
0x0BCC, // a Tamil character that is displayed as three glyphs
|
0x0BCC, // a Tamil character that is displayed as three glyphs
|
||||||
|
@ -114,7 +114,7 @@ class text extends make {
|
||||||
0x205F, // mathematical space
|
0x205F, // mathematical space
|
||||||
0x2061, // mathematical function application
|
0x2061, // mathematical function application
|
||||||
0x2064, // mathematical invisible separator
|
0x2064, // mathematical invisible separator
|
||||||
0x2044 // fraction slash character
|
0x2044 // fraction slash character
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,16 +59,20 @@ class webgl extends make {
|
||||||
|
|
||||||
static match (shader, regex, group = 1) {
|
static match (shader, regex, group = 1) {
|
||||||
let matches = []
|
let matches = []
|
||||||
let match
|
while (true) {
|
||||||
while (match = regex.exec(shader)) {
|
let match = regex.exec(shader)
|
||||||
|
if (match) {
|
||||||
matches.push(match[group])
|
matches.push(match[group])
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return matches
|
return matches
|
||||||
}
|
}
|
||||||
|
|
||||||
static parseUniforms (shader, group = 1) {
|
static parseUniforms (shader, group = 1) {
|
||||||
/* Todo: Parse their individual data types into categories. */
|
/* Todo: Parse their individual data types into categories. */
|
||||||
return webgl.match(shader, /uniform .+? (\w+)(?=[\[;])/gm, group)
|
return webgl.match(shader, /uniform .+? (\w+)(?=[\[;])/gm, group) /* eslint-disable-line no-useless-escape */
|
||||||
}
|
}
|
||||||
|
|
||||||
static parseAttributes (shader, group = 1) {
|
static parseAttributes (shader, group = 1) {
|
||||||
|
@ -86,13 +90,13 @@ class webgl extends make {
|
||||||
|
|
||||||
static parseFragDatav3 (shader, group = 1) {
|
static parseFragDatav3 (shader, group = 1) {
|
||||||
// #version 300
|
// #version 300
|
||||||
return webgl.match(shader, /out .+? (\w+)(?=[\[;])/gm, group)
|
return webgl.match(shader, /out .+? (\w+)(?=[\[;])/gm, group) /* eslint-disable-line no-useless-escape */
|
||||||
}
|
}
|
||||||
|
|
||||||
static parseFrag (shader, group = 1) {
|
static parseFrag (shader, group = 1) {
|
||||||
let matches = webgl.parseFragDatav2(shader)
|
let matches = webgl.parseFragDatav2(shader)
|
||||||
if (matches.length) {
|
if (matches.length) {
|
||||||
return matches
|
return matches
|
||||||
}
|
}
|
||||||
return webgl.parseFragDatav3(shader)
|
return webgl.parseFragDatav3(shader)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue