Browse Source

Merge pull request #8173 from syntheticmagus/removeLookBehindFromShaderCodeInliner

Remove LookBehind from ShaderCodeInliner
sebavan 5 years ago
parent
commit
b0d1a007aa
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Engines/Processors/shaderCodeInliner.ts

+ 2 - 2
src/Engines/Processors/shaderCodeInliner.ts

@@ -10,7 +10,7 @@ interface IInlineFunctionDescr {
 export class ShaderCodeInliner {
 
     static readonly InlineToken = "#define inline";
-    static readonly RegexpFindFunctionNameAndType = /(?<=\s+?(\w+)\s+(\w+)\s*?)$/;
+    static readonly RegexpFindFunctionNameAndType = /((\s+?)(\w+)\s+(\w+)\s*?)$/;
 
     private _sourceCode: string;
     private _functionDescr: IInlineFunctionDescr[];
@@ -66,7 +66,7 @@ export class ShaderCodeInliner {
                 startIndex = inlineTokenIndex + ShaderCodeInliner.InlineToken.length;
                 continue;
             }
-            const [funcType, funcName] = [funcNameMatch[1], funcNameMatch[2]];
+            const [funcType, funcName] = [funcNameMatch[3], funcNameMatch[4]];
 
             // extract the parameters of the function as a whole string (without the leading / trailing parenthesis)
             const funcParamsEndIndex = this._extractBetweenMarkers('(', ')', this._sourceCode, funcParamsStartIndex);