From f714d2e977a9f0fdb1a16d982656bc967ca898e6 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Mon, 24 Aug 2015 11:37:34 -0400 Subject: [PATCH] ignore case with D and F modifiers (fixes #3707) --- core/todo.txt | 14 ++++++-------- .../processing/mode/java/pdex/XQPreprocessor.java | 5 ++++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/todo.txt b/core/todo.txt index 7438c94ab..2fdf049c3 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -34,8 +34,9 @@ X https://github.com/processing/processing/issues/3690 X https://github.com/processing/processing/pull/3692 X Remove support for fixed-function pipeline X https://github.com/processing/processing/issues/3505 -_ NullPointerException in Demos > Graphics > Planets -_ https://github.com/processing/processing/issues/3551 +X NullPointerException in Demos > Graphics > Planets +X https://github.com/processing/processing/issues/3551 +X turns out to be a problem with capitalization cleaning X How do images behave when pixelDensity(2) is set? @@ -56,12 +57,6 @@ _ P2D and P3D windows behave strangely when larger than the screen size _ https://github.com/processing/processing/issues/3401 -docs -_ note that full screen and present are now different -_ on Export to Application, this has an impact -_ update wiki/docs to say "don't override sketchXxxx() methods" - - 3.0 final _ move blending calculations from PImage into PGraphics _ tricky because that means moving blend_resize() as well @@ -77,6 +72,9 @@ _ use the BufferStrategy directly from the Frame object? _ might fix performance issues w/ Presentation mode _ sketch placement (window insets) not properly set on Linux _ https://github.com/processing/processing/issues/2063 +_ note in docs that full screen and present are now different +_ on Export to Application, this has an impact +_ update wiki/docs to say "don't override sketchXxxx() methods" javafx diff --git a/java/src/processing/mode/java/pdex/XQPreprocessor.java b/java/src/processing/mode/java/pdex/XQPreprocessor.java index d522c36dc..20a4d3af2 100644 --- a/java/src/processing/mode/java/pdex/XQPreprocessor.java +++ b/java/src/processing/mode/java/pdex/XQPreprocessor.java @@ -160,7 +160,10 @@ public class XQPreprocessor { public boolean visit(NumberLiteral node) { - if (!node.getToken().endsWith("f") && !node.getToken().endsWith("d")) { + // Need to handle both 1.0F and 1.0D cases + // https://github.com/processing/processing/issues/3707 + String lower = node.getToken().toLowerCase(); + if (!lower.endsWith("f") && !lower.endsWith("d")) { for (int i = 0; i < node.getToken().length(); i++) { if (node.getToken().charAt(i) == '.') { String s = node.getToken() + "f";