[Jython-checkins] jython: Fix parsing b"..." literals.

frank.wierzbicki jython-checkins at python.org
Mon Feb 6 18:41:42 CET 2012


http://hg.python.org/jython/rev/332b2490f53e
changeset:   6301:332b2490f53e
parent:      6298:2b4f725d4d29
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Fri Feb 03 09:48:50 2012 -0800
summary:
  Fix parsing b"..." literals.

files:
  src/org/python/antlr/GrammarActions.java |  5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/src/org/python/antlr/GrammarActions.java b/src/org/python/antlr/GrammarActions.java
--- a/src/org/python/antlr/GrammarActions.java
+++ b/src/org/python/antlr/GrammarActions.java
@@ -459,6 +459,11 @@
             ustring = true;
             start++;
         }
+        if (quoteChar == 'b' || quoteChar == 'B') {
+            // In 2.x this is just a str, and the parser prevents a 'u' and a
+            // 'b' in the same identifier, so just advance start.
+            start++;
+        }
         quoteChar = string.charAt(start);
         boolean raw = false;
         if (quoteChar == 'r' || quoteChar == 'R') {

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list