From 7aafcd0eaccf78ac570f843013ed908e96420bf3 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Sat, 26 Oct 2024 10:56:47 -0400 Subject: [PATCH] Add bulk renaming --- src/main/java/org/taumc/glsl/Util.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/taumc/glsl/Util.java b/src/main/java/org/taumc/glsl/Util.java index ff27963..cb90f07 100644 --- a/src/main/java/org/taumc/glsl/Util.java +++ b/src/main/java/org/taumc/glsl/Util.java @@ -63,7 +63,11 @@ public static void injectFunction(GLSLParser.Translation_unitContext root, Strin } public static void rename(GLSLParser.Translation_unitContext root, String oldName, String newName) { - ParseTreeWalker.DEFAULT.walk(new Renamer(Collections.singletonMap(oldName, newName)), root); + rename(root, Collections.singletonMap(oldName, newName)); + } + + public static void rename(GLSLParser.Translation_unitContext root, Map names) { + ParseTreeWalker.DEFAULT.walk(new Renamer(names), root); } public static void replaceExpression(GLSLParser.Translation_unitContext root, String oldCode, String newCode) {