|
From: <fwi...@us...> - 2011-03-28 04:17:43
|
Revision: 7272
http://jython.svn.sourceforge.net/jython/?rev=7272&view=rev
Author: fwierzbicki
Date: 2011-03-28 04:17:37 +0000 (Mon, 28 Mar 2011)
Log Message:
-----------
Convert fpdef from rewrite action to regular action for consistency.
Modified Paths:
--------------
trunk/jython/grammar/Python.g
Modified: trunk/jython/grammar/Python.g
===================================================================
--- trunk/jython/grammar/Python.g 2011-03-28 01:33:33 UTC (rev 7271)
+++ trunk/jython/grammar/Python.g 2011-03-28 04:17:37 UTC (rev 7272)
@@ -528,15 +528,24 @@
//fpdef: NAME | '(' fplist ')'
fpdef[expr_contextType ctype]
+@init {
+ expr etype = null;
+}
@after {
+ if (etype != null) {
+ $fpdef.tree = etype;
+ }
actions.checkAssign(actions.castExpr($fpdef.tree));
}
: NAME
- -> ^(NAME<Name>[$NAME, $NAME.text, ctype])
+ {
+ etype = new Name($NAME, $NAME.text, ctype);
+ }
| (LPAREN fpdef[null] COMMA) => LPAREN fplist RPAREN
- -> ^(LPAREN<Tuple>[$fplist.start, actions.castExprs($fplist.etypes), expr_contextType.Store])
- | LPAREN fplist RPAREN
- -> fplist
+ {
+ etype = new Tuple($fplist.start, actions.castExprs($fplist.etypes), expr_contextType.Store);
+ }
+ | LPAREN! fplist RPAREN!
;
//fplist: fpdef (',' fpdef)* [',']
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|