From: <fwi...@us...> - 2008-08-23 19:43:21
|
Revision: 5239 http://jython.svn.sourceforge.net/jython/?rev=5239&view=rev Author: fwierzbicki Date: 2008-08-23 19:43:19 +0000 (Sat, 23 Aug 2008) Log Message: ----------- Fine tuning List and Assign col position. Modified Paths: -------------- branches/nowalker/build.xml branches/nowalker/grammar/Python.g Modified: branches/nowalker/build.xml =================================================================== --- branches/nowalker/build.xml 2008-08-23 19:19:16 UTC (rev 5238) +++ branches/nowalker/build.xml 2008-08-23 19:43:19 UTC (rev 5239) @@ -318,9 +318,7 @@ change to grammar files. If you are working on the grammars you might want to comment this out, as a clean is really only needed if you change the tokens defined in Python.g (and cleans make the build slow) --> - <antcall target="clean"/> <!-- force jarjar build --> - <property name="jarjar.needed" value="true" /> </target> <target name ="prepare-output" depends="init,needed-check,clean-if-antlr-needed,make-output-dirs"/> Modified: branches/nowalker/grammar/Python.g =================================================================== --- branches/nowalker/grammar/Python.g 2008-08-23 19:19:16 UTC (rev 5238) +++ branches/nowalker/grammar/Python.g 2008-08-23 19:43:19 UTC (rev 5239) @@ -464,8 +464,8 @@ ) |(testlist[null] ASSIGN) => lhs=testlist[expr_contextType.Store] ( - | ((at=ASSIGN t+=testlist[expr_contextType.Store])+ -> ^(PYNODE<Assign>[$at, actions.makeAssignTargets((exprType)$lhs.tree, $t), actions.makeAssignValue($t)])) - | ((ay=ASSIGN y2+=yield_expr)+ -> ^(PYNODE<Assign>[$ay, actions.makeAssignTargets((exprType)$lhs.tree, $y2), actions.makeAssignValue($y2)])) + | ((at=ASSIGN t+=testlist[expr_contextType.Store])+ -> ^(PYNODE<Assign>[$lhs.start, actions.makeAssignTargets((exprType)$lhs.tree, $t), actions.makeAssignValue($t)])) + | ((ay=ASSIGN y2+=yield_expr)+ -> ^(PYNODE<Assign>[$lhs.start, actions.makeAssignTargets((exprType)$lhs.tree, $y2), actions.makeAssignValue($y2)])) ) | lhs=testlist[expr_contextType.Load] -> PYNODE<Expr>[$lhs.start, (exprType)$lhs.tree] ) @@ -1022,7 +1022,7 @@ ) RPAREN | LBRACK - (listmaker -> listmaker + (listmaker[$LBRACK] -> listmaker | -> ^(LBRACK<org.python.antlr.ast.List>[$LBRACK, new exprType[0\], $expr::ctype]) ) RBRACK @@ -1042,7 +1042,7 @@ ; //listmaker: test ( list_for | (',' test)* [','] ) -listmaker +listmaker[Token lbrack] @init { List gens = new ArrayList(); exprType etype = null; @@ -1054,10 +1054,10 @@ ( list_for[gens] { Collections.reverse(gens); comprehensionType[] c = (comprehensionType[])gens.toArray(new comprehensionType[gens.size()]); - etype = new ListComp($listmaker.start, (exprType)$t.get(0), c); + etype = new ListComp($lbrack, (exprType)$t.get(0), c); } | (options {greedy=true;}:COMMA t+=test[expr_contextType.Load])* { - etype = new org.python.antlr.ast.List($listmaker.start, actions.makeExprs($t), $expr::ctype); + etype = new org.python.antlr.ast.List($lbrack, actions.makeExprs($t), $expr::ctype); } ) (COMMA)? ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |