diff --git a/java/src/processing/mode/java/tweak/SketchParser.java b/java/src/processing/mode/java/tweak/SketchParser.java index 487ce8ad2..fd2843d87 100644 --- a/java/src/processing/mode/java/tweak/SketchParser.java +++ b/java/src/processing/mode/java/tweak/SketchParser.java @@ -60,14 +60,14 @@ public class SketchParser { // add 'settings' and 'setup' to ignore list (to ignore all numbers there) ignoreFunctions = new ArrayList<>(); - ignoreFunctions.add(Arrays.asList(new Range(getVoidFunctionStart(codeTabs[0], "settings"), - getVoidFunctionEnd(codeTabs[0], "settings")), - new Range(getVoidFunctionStart(codeTabs[0], "setup"), - getVoidFunctionEnd(codeTabs[0], "setup")))); - + Range settingsRange = getVoidFunctionRange(codeTabs[0], "settings"); + Range setupRange = getVoidFunctionRange(codeTabs[0], "setup"); + ignoreFunctions.add(Arrays.asList(settingsRange, setupRange)); + //Add empty lists for the other tabs so we do not get an index out of bounds error later - for(int i = 0; i < codeTabs.length-1; i++) - ignoreFunctions.add(Collections.EMPTY_LIST); + for (int i = 0; i < codeTabs.length-1; i++) { + ignoreFunctions.add(new ArrayList()); + } // build curly scope for every character in the code curlyScopes = new ArrayList<>(); @@ -839,6 +839,11 @@ public class SketchParser { return obj; } + static public Range getVoidFunctionRange(String code, String functionName) { + return new Range(getVoidFunctionStart(code, functionName), + getVoidFunctionEnd(code, functionName)); + } + static public int getVoidFunctionStart(String code, String functionName) { Pattern p = Pattern.compile("void[\\s\\t\\r\\n]*"+functionName+"[\\s\\t]*\\(\\)[\\s\\t\\r\\n]*\\{"); Matcher m = p.matcher(code); diff --git a/todo.txt b/todo.txt index b20aeb85e..e82136bd4 100644 --- a/todo.txt +++ b/todo.txt @@ -21,6 +21,11 @@ X updates for serial X https://github.com/processing/processing/pull/4015 _ Saving sketch with the same name as a class _ https://github.com/processing/processing/pull/4033 +_ infinite "file changed" popups +_ https://github.com/processing/processing/issues/3965 +_ https://github.com/processing/processing/pull/4037 +_ Pasting text into PDE results in "Clipboard does not contain a string +_ https://github.com/processing/processing/pull/4040 jakub X Include Example packs into update count