MCPcopy Create free account
hub / github.com/ShaderFrog/glsl-parser / renameFunctions

Function renameFunctions

src/parser/utils.ts:112–125  ·  view source on GitHub ↗
(
  functions: FunctionScopeIndex,
  mangle: (name: string) => string
)

Source from the content-addressed store, hash-verified

110};
111
112export const renameFunctions = (
113 functions: FunctionScopeIndex,
114 mangle: (name: string) => string
115) =>
116 Object.entries(functions).reduce<FunctionScopeIndex>(
117 (acc, [fnName, overloads]) => {
118 const mangled = mangle(fnName);
119 return {
120 ...acc,
121 [mangled]: renameFunction(overloads, mangled),
122 };
123 },
124 {}
125 );
126
127export const xor = (a: any, b: any): boolean => (a || b) && !(a && b);
128

Callers 1

scope.test.tsFile · 0.85

Calls 1

renameFunctionFunction · 0.85

Tested by

no test coverage detected