From: <fwi...@us...> - 2008-08-31 00:31:38
|
Revision: 5275 http://jython.svn.sourceforge.net/jython/?rev=5275&view=rev Author: fwierzbicki Date: 2008-08-31 00:31:36 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Fixes #1116 -- dotted_attr was calling itself, which does not make sense with +=. Modified Paths: -------------- trunk/jython/grammar/Python.g trunk/jython/src/org/python/antlr/GrammarActions.java Modified: trunk/jython/grammar/Python.g =================================================================== --- trunk/jython/grammar/Python.g 2008-08-30 18:39:59 UTC (rev 5274) +++ trunk/jython/grammar/Python.g 2008-08-31 00:31:36 UTC (rev 5275) @@ -309,8 +309,8 @@ //not in CPython's Grammar file dotted_attr returns [exprType etype] : n1=NAME - ( (DOT n2+=dotted_attr)+ { $etype = actions.makeDottedAttr($n1, $n2); } - | { $etype = new Name($NAME, $NAME.text, expr_contextType.Load); } + ( (DOT n2+=NAME)+ { $etype = actions.makeDottedAttr($n1, $n2); } + | { $etype = new Name($n1, $n1.text, expr_contextType.Load); } ) ; Modified: trunk/jython/src/org/python/antlr/GrammarActions.java =================================================================== --- trunk/jython/src/org/python/antlr/GrammarActions.java 2008-08-30 18:39:59 UTC (rev 5274) +++ trunk/jython/src/org/python/antlr/GrammarActions.java 2008-08-31 00:31:36 UTC (rev 5275) @@ -212,8 +212,8 @@ exprType makeDottedAttr(Token nameToken, List attrs) { exprType current = new Name(nameToken, nameToken.getText(), expr_contextType.Load); - for (int i=attrs.size() - 1; i > -1; i--) { - Token t = ((PythonTree)attrs.get(i)).token; + for (Object o: attrs) { + Token t = (Token)o; current = new Attribute(t, current, t.getText(), expr_contextType.Load); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |