Sat, 14 Jul 2012 16:28:42 +0300
If any optional parameters are skipped, default values are now filled in.
parser.cxx | file | annotate | diff | comparison | revisions |
--- a/parser.cxx Sat Jul 14 16:24:57 2012 +0300 +++ b/parser.cxx Sat Jul 14 16:28:42 2012 +0300 @@ -133,6 +133,7 @@ ParserError ("got `,` while expecting command-terminating `)`, are you passing too many parameters? (max %d)", comm->maxargs); MustNext (")"); + curarg++; break; } @@ -157,6 +158,7 @@ // Can continue, but can terminate as well. if (!PeekNext ().compare (")")) { MustNext (")"); + curarg++; break; } else MustNext (","); @@ -165,6 +167,12 @@ curarg++; } MustNext (";"); + + // If the script skipped a few arguments, fill in defaults. + while (curarg < comm->maxargs) { + w->Write<long> (comm->defvals[curarg]); + curarg++; + } } else ParserError ("unknown keyword `%s`!", token.chars()); }