From 07bb5056f9c70f488951db65371c36a60c5bb9f3 Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 13 Nov 2012 01:53:09 +0000 Subject: [PATCH] fix for imports problem (issue #1376) --- android/todo.txt | 2 ++ .../mode/java/preproc/PdePreprocessor.java | 15 ++++++---- core/todo.txt | 28 +++++++++++++++---- todo.txt | 8 ++++-- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/android/todo.txt b/android/todo.txt index cba4e1c17..e926824a9 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -15,6 +15,8 @@ _ internally, PApplet might subclass it for the pointers _ but queueing needs to work _ coordinates from motionX/Y reportedly inconsistent _ http://code.google.com/p/processing/issues/detail?id=1018 +_ pmouseX/Y not being set properly? +_ http://code.google.com/p/processing/issues/detail?id=238 _ Android emulator doesn't always start on the first attempt _ http://code.google.com/p/processing/issues/detail?id=1210 diff --git a/app/src/processing/mode/java/preproc/PdePreprocessor.java b/app/src/processing/mode/java/preproc/PdePreprocessor.java index 990227683..3a966d103 100644 --- a/app/src/processing/mode/java/preproc/PdePreprocessor.java +++ b/app/src/processing/mode/java/preproc/PdePreprocessor.java @@ -509,9 +509,11 @@ public class PdePreprocessor { program = substituteUnicode(program); } + // For 0215, adding } as a legitimate prefix to the import (along with + // newline and semicolon) for cases where a tab ends with } and an import + // statement starts the next tab. final String importRegexp = - "((?:^|;)\\s*)(import\\s+)((?:static\\s+)?\\S+)(\\s*;)"; - //"(?:^|;)\\s*(import\\s+)((?:static\\s+)?\\S+)(\\s*;)"; + "((?:^|;|\\})\\s*)(import\\s+)((?:static\\s+)?\\S+)(\\s*;)"; final Pattern importPattern = Pattern.compile(importRegexp); String scrubbed = scrubComments(program); Matcher m = null; @@ -534,18 +536,19 @@ public class PdePreprocessor { int start = m.start() + before.length(); int stop = start + piece.length(); // System.out.println(start + " " + stop + " " + piece); + //System.out.println("found " + m.group(3)); +// System.out.println("removing '" + program.substring(start, stop) + "'"); // Remove the import from the main program program = program.substring(0, start) + program.substring(stop); scrubbed = scrubbed.substring(0, start) + scrubbed.substring(stop); // Set the offset to start, because everything between // start and stop has been deleted. - offset = m.start(); - -// System.out.println("program now:"); -// System.out.println(program); + offset = m.start(); } } while (found); +// System.out.println("program now:"); +// System.out.println(program); if (codeFolderPackages != null) { for (String item : codeFolderPackages) { diff --git a/core/todo.txt b/core/todo.txt index d3e1351ce..b914aa8c3 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,22 +1,38 @@ 0215 core X change to getRows() method for iterating through the Table object X add parseInto() method (provisional) +X change translate() and rotate() to use x, y, z as param names cleaning o remove screenBlend(), textureBlend() from PGraphics et al o have andres take over all current GL issues in the tracker +events +_ finish postEvent() _ need to make events interleave - -_ change translate() and rotate() to use x, y, z as param names - -_ add "CGAffineTransformInvert: singular matrix" problem to the Wiki -_ http://code.google.com/p/processing/issues/detail?id=1363 - +_ http://code.google.com/p/processing/issues/detail?id=79 _ mouseButton not being set properly in mouseClicked _ http://code.google.com/p/processing/issues/detail?id=1350 _ mouseButton is 0 in mouseReleased() on OS X _ http://code.google.com/p/processing/issues/detail?id=1373 +_ unconfirmed: keyEvent works only using JAVA2D +_ http://code.google.com/p/processing/issues/detail?id=1279 +_ mouseEntered/Exited? +_ http://code.google.com/p/processing/issues/detail?id=500 +_ also look into Android issues with this stuff +_ this only works for awt events... switch to using internal event code +if (external && event.getNative() instanceof java.awt.event.KeyEvent && + ((java.awt.event.KeyEvent) event.getNative()).getModifiers() == + Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() && + event.getKeyCode() == 'W') { + exit(); + } + +_ add "CGAffineTransformInvert: singular matrix" problem to the Wiki +_ http://code.google.com/p/processing/issues/detail?id=1363 + +_ heading2D()? weird.. angle? +_ http://code.google.com/p/processing/issues/detail?id=987 _ "translate, or this variation of it" when using text(s, x, y, z) accidentally _ change to be th text command diff --git a/todo.txt b/todo.txt index 542487745..141952593 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,7 @@ 0215 pde +X "expecting EOF, found 'import'" on previously working sketch +X http://code.google.com/p/processing/issues/detail?id=1376 + _ standard "Emacs" keybindings not implemented on OS X _ http://code.google.com/p/processing/issues/detail?id=1354 _ http://guides.macrumors.com/Keyboard_shortcuts§ion=10#Text_Shortcuts @@ -19,11 +22,10 @@ control-Y paste text previously deleted with control-K http://download.eclipse.org/eclipse/downloads/ -_ clientEvent() called even w/o data from server +_ clientEvent() called even w/o data from server (with fix) _ http://code.google.com/p/processing/issues/detail?id=189 _ check on adding ip() method - _ Sketch that exported to Linux doesn't get the command line arguments _ http://code.google.com/p/processing/issues/detail?id=1359 @@ -477,6 +479,8 @@ _ it's never useful. students can use { } if they want an empty block _ missing brackets, unmatched brackets _ examples added to the bug report _ http://code.google.com/p/processing/issues/detail?id=6 +_ enums not supported properly +_ http://code.google.com/p/processing/issues/detail?id=1352 low (features) _ copy running code from /tmp/buildXXxxx on crash of p5