[Gridflow-cvs] [svn] commit: r5667 - in /trunk/src: gridflow.hxx source_filter.rb

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Wed May 12 18:53:51 EDT 2010


Author: matju
Date: Wed May 12 18:53:51 2010
New Revision: 5667

Log:
add EXACTARGS

Modified:
    trunk/src/gridflow.hxx
    trunk/src/source_filter.rb

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Wed May 12 18:53:51 2010
@@ -219,10 +219,13 @@
 	for (int q=0; q<n; q++) p += sprintf(p,"%lld ",(long long)ar[q]); \
 	post("%s",foo);}
 
-#define    MINARGS(CONTEXT,ARGC,MIN    ) if ((ARGC)<(MIN)                ) \
-	RAISE("in %s, got %d args instead of at least %d"            ,(CONTEXT),(ARGC),(MIN)      );
-#define MINMAXARGS(CONTEXT,ARGC,MIN,MAX) if ((ARGC)<(MIN) || (ARGC)>(MAX)) \
-	RAISE("in %s, got %d args instead of at least %d, at most %d",(CONTEXT),(ARGC),(MIN),(MAX));
+#define  EXACTARGS(N      ) if (argc!=(N)             ) \
+	RAISE("in %s, got %d args instead of %d"                     ,context,argc,(N));
+#define    MINARGS(MIN    ) if (argc<(MIN)            ) \
+	RAISE("in %s, got %d args instead of at least %d"            ,context,argc,(MIN));
+#define MINMAXARGS(MIN,MAX) if (argc<(MIN)||argc>(MAX)) \
+	RAISE("in %s, got %d args instead of at least %d, at most %d",context,argc,(MIN),(MAX));
+
 #define CLASSINFO(THISCLASS) \
 	static void THISCLASS##_startup (FClass *fclass); \
 	static FObject *THISCLASS##_allocator (BFObject *bself, MESSAGE) {return new THISCLASS(bself,sel,argc,argv);} \

Modified: trunk/src/source_filter.rb
==============================================================================
--- trunk/src/source_filter.rb (original)
+++ trunk/src/source_filter.rb Wed May 12 18:53:51 2010
@@ -145,8 +145,9 @@
 end
 
 def check_argc(m)
-	if m.maxargs==-1 then Out.print    "MINARGS(context,argc,#{m.minargs})"
-	else                  Out.print "MINMAXARGS(context,argc,#{m.minargs},#{m.maxargs})" end
+	if    m.maxargs==m.minargs then Out.print  "EXACTARGS(#{m.minargs})"
+	elsif m.maxargs==-1        then Out.print    "MINARGS(#{m.minargs})"
+	else                            Out.print "MINMAXARGS(#{m.minargs},#{m.maxargs})" end
 end
 
 def pass_args(m)



More information about the Gridflow-cvs mailing list