Menu

Diff of /trunk/python/python.lime [r30] .. [r31]  Maximize  Restore

Switch to side-by-side view

--- a/trunk/python/python.lime
+++ b/trunk/python/python.lime
@@ -35,6 +35,63 @@
 small_stmt 
 	= expr_stmt 
 	| print_stmt 
+	.
+
+funcdef
+	= DEF NAME parameters COLON suite
+	.
+
+parameters
+	= RBO varargslist RBC
+	| RBO RBC
+	.
+
+varargslist
+	= fpdef_rc_star  STAR NAME COMMA DSTAR NAME
+	| fpdef_rc_star  STAR NAME 
+	| fpdef_rc_star DSTAR NAME
+	| fpdef EQUAL test (COMMA fpdef [EQUAL test])* COMMA
+	| fpdef (COMMA fpdef [EQUAL test])* COMMA
+	| fpdef EQUAL test (COMMA fpdef [EQUAL test])* 
+	| fpdef (COMMA fpdef [EQUAL test])* 
+	.
+
+fpdef_rc_star
+	= fpdef_rc_star fpdef_rc	
+	| fpdef_rc
+	| 
+	.
+
+fpdef_rc
+	= fpdef EQUAL test COMMA
+	| fpdef COMMA
+	.
+
+fpdef_lc_star
+	= fpdef_lc_star fpdef_lc	
+	| fpdef_lc
+	| 
+	.
+
+fpdef_lc
+	= COMMA fpdef EQUAL test
+	| COMMA fpdef
+	.
+
+fpdef
+	= NAME 
+	| RBO fplist RBC
+	.
+
+fplist
+	= fpdef fpdefs COMMA
+	| fpdef fpdefs
+	.
+
+fpdefs
+	= fpdefs COMMA fpdef
+	| COMMA fpdef
+	|
 	.
 
 expr_stmt
@@ -62,6 +119,7 @@
 
 compound_stmt 
 	= while_stmt
+	| funcdef
 	| classdef
 	.