浏览代码

program: make unroll loop regexp accept other coding style

David Peicho 5 年之前
父节点
当前提交
f09f4fa044
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/renderers/webgl/WebGLProgram.js

+ 1 - 1
src/renderers/webgl/WebGLProgram.js

@@ -220,7 +220,7 @@ function includeReplacer( match, include ) {
 // Unroll Loops
 // Unroll Loops
 
 
 const deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
 const deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
-const unrollLoopPattern = /#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;
+const unrollLoopPattern = /#pragma unroll_loop_start[\s]+?for\s*\(\s*int i \= (\d+)\; i < (\d+)\; i\s*\+\+\s*\)\s*{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;
 
 
 function unrollLoops( string ) {
 function unrollLoops( string ) {