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') {
|
||||
try {
|
||||
print(msg) // eslint-disable-line no-undef
|
||||
print(msg) // eslint-disable-line no-undef
|
||||
} catch (e) {
|
||||
console.log(msg)
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ class text extends make {
|
|||
|
||||
static layoutCharCodes () {
|
||||
return random.pick([
|
||||
0, // null
|
||||
160, // non-breaking space
|
||||
0, // null
|
||||
160, // non-breaking space
|
||||
0x005C, // backslash, but in some countries, represents local currency symbol (e.g. yen)
|
||||
0x00AD, // soft hyphen
|
||||
0x0BCC, // a Tamil character that is displayed as three glyphs
|
||||
|
@ -114,7 +114,7 @@ class text extends make {
|
|||
0x205F, // mathematical space
|
||||
0x2061, // mathematical function application
|
||||
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) {
|
||||
let matches = []
|
||||
let match
|
||||
while (match = regex.exec(shader)) {
|
||||
while (true) {
|
||||
let match = regex.exec(shader)
|
||||
if (match) {
|
||||
matches.push(match[group])
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
return matches
|
||||
}
|
||||
|
||||
static parseUniforms (shader, group = 1) {
|
||||
/* 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) {
|
||||
|
@ -86,13 +90,13 @@ class webgl extends make {
|
|||
|
||||
static parseFragDatav3 (shader, group = 1) {
|
||||
// #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) {
|
||||
let matches = webgl.parseFragDatav2(shader)
|
||||
if (matches.length) {
|
||||
return matches
|
||||
return matches
|
||||
}
|
||||
return webgl.parseFragDatav3(shader)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue