From: <fwi...@us...> - 2009-01-07 23:57:43
|
Revision: 5871 http://jython.svn.sourceforge.net/jython/?rev=5871&view=rev Author: fwierzbicki Date: 2009-01-07 23:57:33 +0000 (Wed, 07 Jan 2009) Log Message: ----------- update grammar comments. Modified Paths: -------------- branches/jy3k/grammar/Python.g Modified: branches/jy3k/grammar/Python.g =================================================================== --- branches/jy3k/grammar/Python.g 2009-01-07 21:21:48 UTC (rev 5870) +++ branches/jy3k/grammar/Python.g 2009-01-07 23:57:33 UTC (rev 5871) @@ -430,7 +430,10 @@ } ; -//funcdef: [decorators] 'def' NAME parameters ':' suite +//XXX: maybe see if we can factor decorators out like this... +//decorated: decorators (classdef | funcdef) + +//funcdef: 'def' NAME parameters ['->' test] ':' suite funcdef @init { stmt stype = null; } @after { $funcdef.tree = stype; } @@ -741,7 +744,7 @@ } ; -//import_as_name: NAME [('as' | NAME) NAME] +//import_as_name: NAME ['as' NAME] import_as_name returns [alias atype] @after { $import_as_name.tree = $atype; @@ -795,7 +798,7 @@ -> ^(ASSERT<Assert>[$ASSERT, actions.castExpr($t1.tree), actions.castExpr($t2.tree)]) ; -//compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef +//compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated compound_stmt : if_stmt | while_stmt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |