SF.net SVN: jython:[7272] trunk/jython/grammar/Python.g

[email protected] Mon, 28 Mar 2011 04:17:37 +0000
Newsgroups gmane.comp.lang.jython.cvs
Message-ID <[email protected]>
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.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar