Skip to content

Commit 79e9661

Browse files
committed
Simplify regex
1 parent b8a91c5 commit 79e9661

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/libwebgl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3273,7 +3273,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
32733273
// Remove all the layout(binding = x) directives so that they do not make
32743274
// their way to the actual WebGL shader compiler. These regexes get quite
32753275
// hairy, check against https://regex101.com/ when working on these.
3276-
source = source.replace(/layout\s*\([^,]*?binding\s*=\s*([-\d]+)[^,]*?\)/g, ''); // "layout(binding = 3)" -> ""
3276+
source = source.replace(/layout\s*\(\s*binding\s*=\s*([-\d]+)\s*\)/g, ''); // "layout(binding = 3)" -> ""
32773277
source = source.replace(/(layout\s*\((.*?)),\s*binding\s*=\s*([-\d]+)\)/g, '$1)'); // "layout(std140, binding = 1)" -> "layout(std140)"
32783278
source = source.replace(/layout\s*\(\s*binding\s*=\s*([-\d]+)\s*,\s*(.*?)\)/g, 'layout($2)'); // "layout(binding = 1, std140)" -> "layout(std140)"
32793279

0 commit comments

Comments
 (0)