[Jython-checkins] jython (2.5): Fix http://bugs.jython.org/issue1764: Broken behavior with (a + b).foo = bar.

frank.wierzbicki jython-checkins at python.org
Mon Sep 5 01:48:42 CEST 2011


http://hg.python.org/jython/rev/dc4ebe0a697f
changeset:   6244:dc4ebe0a697f
branch:      2.5
parent:      6233:d75393f1eb8d
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Sun Sep 04 16:31:24 2011 -0700
summary:
  Fix http://bugs.jython.org/issue1764: Broken behavior with (a + b).foo = bar.

Make left hand side argument recursively correct Store->Load in the case where
there are child elements and a Call, Subscript, etc.

files:
  ast/astview.py                           |  Bin 
  grammar/Python.g                         |    4 +---
  src/org/python/antlr/GrammarActions.java |    1 -
  3 files changed, 1 insertions(+), 4 deletions(-)


diff --git a/ast/astview.py b/ast/astview.py
old mode 100644
new mode 100755
diff --git a/grammar/Python.g b/grammar/Python.g
--- a/grammar/Python.g
+++ b/grammar/Python.g
@@ -1588,9 +1588,7 @@
           $etype = actions.castExpr($atom.tree);
           if ($t != null) {
               for(Object o : $t) {
-                  if ($etype instanceof Context) {
-                      ((Context)$etype).setContext(expr_contextType.Load);
-                  }
+                  actions.recurseSetContext($etype, expr_contextType.Load);
                   if (o instanceof Call) {
                       Call c = (Call)o;
                       c.setFunc((PyObject)$etype);
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
@@ -615,7 +615,6 @@
     }
 
     void checkDelete(expr e) {
-        //System.out.println("trying to del " + e);
         if (e instanceof Call) {
             errorHandler.error("can't delete function call", e);
         } else if (e instanceof Num) {

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


More information about the Jython-checkins mailing list