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

Function renameType

src/parser/utils.ts:46–56  ·  view source on GitHub ↗
(type: TypeScopeEntry, newName: string)

Source from the content-addressed store, hash-verified

44 }, {});
45
46export const renameType = (type: TypeScopeEntry, newName: string) => {
47 type.references.forEach((node) => {
48 if (node.type === 'type_name') {
49 node.identifier = newName;
50 } else {
51 console.warn('Unknown type node', node);
52 throw new Error(`Type ${node.type} not recognized`);
53 }
54 });
55 return type;
56};
57
58export const renameTypes = (
59 types: TypeScopeIndex,

Callers 1

renameTypesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected