From 7abe891766135b36e538b26e7d2433d3bf2a40b2 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Sat, 20 Apr 2024 01:46:24 -0600 Subject: Fix many more issues with goto/branch found with GraphViz --- vaporize/library/Kettle.java | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'vaporize/library/Kettle.java') diff --git a/vaporize/library/Kettle.java b/vaporize/library/Kettle.java index d76c938..38c941a 100644 --- a/vaporize/library/Kettle.java +++ b/vaporize/library/Kettle.java @@ -71,6 +71,20 @@ class Kettle { return String.join("\n", this.vapor); } + private void set(Node n, String s) { + /** + * Sets the position of Node n in the original + * file to String s. + */ + this.vapor.set(this.indexOf(n), s); + } + + protected int indexOf(Node n) { + return n.sourcePos.line-1; + } + + // METHODS INTENDED TO BE USED WITH CFG + /** * Needed because VBranch doesn't seem to * keep track of this... @@ -99,16 +113,4 @@ class Kettle { return index+1; } - protected int indexOf(Node n) { - return n.sourcePos.line-1; - } - - private void set(Node n, String s) { - /** - * Sets the position of Node n in the original - * file to String s. - */ - this.vapor.set(this.indexOf(n), s); - } - } -- cgit v1.2.3