From: <fwi...@us...> - 2009-01-09 04:32:45
|
Revision: 5898 http://jython.svn.sourceforge.net/jython/?rev=5898&view=rev Author: fwierzbicki Date: 2009-01-09 04:32:35 +0000 (Fri, 09 Jan 2009) Log Message: ----------- list_for, list_if, list_iter no longer needed. Modified Paths: -------------- branches/jy3k/grammar/Python.g Modified: branches/jy3k/grammar/Python.g =================================================================== --- branches/jy3k/grammar/Python.g 2009-01-09 04:24:28 UTC (rev 5897) +++ branches/jy3k/grammar/Python.g 2009-01-09 04:32:35 UTC (rev 5898) @@ -1249,7 +1249,7 @@ -> ^(BYTES<Bytes>[actions.extractStringToken($B), actions.extractBytes($B, encoding)]) ; -//listmaker: test ( list_for | (',' test)* [','] ) +//listmaker: test ( comp_for | (',' test)* [','] ) listmaker[Token lbrack] @init { expr etype = null; @@ -1259,7 +1259,7 @@ $listmaker.tree = etype; } : t+=test[$expr::ctype] - (list_for[gens] + (comp_for[gens] { Collections.reverse(gens); List<comprehension> c = gens; @@ -1538,32 +1538,6 @@ ) ; -//list_iter: list_for | list_if -list_iter [List gens, List ifs] - : list_for[gens] - | list_if[gens, ifs] - ; - -//list_for: 'for' exprlist 'in' testlist_safe [list_iter] -list_for [List gens] -@init { - List ifs = new ArrayList(); -} - : FOR exprlist[expr_contextType.Store] IN testlist[expr_contextType.Load] (list_iter[gens, ifs])? - { - Collections.reverse(ifs); - gens.add(new comprehension($FOR, $exprlist.etype, actions.castExpr($testlist.tree), ifs)); - } - ; - -//list_if: 'if' test [list_iter] -list_if[List gens, List ifs] - : IF test[expr_contextType.Load] (list_iter[gens, ifs])? - { - ifs.add(actions.castExpr($test.tree)); - } - ; - //comp_iter: comp_for | comp_if comp_iter [List gens, List ifs] : comp_for[gens] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |