- removed tkAny as the default value of Lexer::MustGetNext to prevent problems like the one last commit fixed

Sun, 09 Feb 2014 15:06:37 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 09 Feb 2014 15:06:37 +0200
changeset 103
48472c0678cc
parent 102
28f89ca1a236
child 104
62da929f7814

- removed tkAny as the default value of Lexer::MustGetNext to prevent problems like the one last commit fixed

src/Expression.cc file | annotate | diff | comparison | revisions
src/Lexer.cc file | annotate | diff | comparison | revisions
src/Lexer.h file | annotate | diff | comparison | revisions
src/Parser.cc file | annotate | diff | comparison | revisions
--- a/src/Expression.cc	Sun Feb 09 15:03:44 2014 +0200
+++ b/src/Expression.cc	Sun Feb 09 15:06:37 2014 +0200
@@ -77,7 +77,7 @@
 
 	try
 	{
-		mLexer->MustGetNext();
+		mLexer->MustGetNext (tkAny);
 
 		if (mLexer->GetTokenType() == tkColon)
 			return new ExpressionColon;
--- a/src/Lexer.cc	Sun Feb 09 15:03:44 2014 +0200
+++ b/src/Lexer.cc	Sun Feb 09 15:06:37 2014 +0200
@@ -164,13 +164,13 @@
 
 // =============================================================================
 //
-void Lexer::MustGetNext (EToken tt)
+void Lexer::MustGetNext (EToken tok)
 {
 	if (!GetNext())
 		Error ("unexpected EOF");
 
-	if (tt != tkAny)
-		TokenMustBe (tt);
+	if (tok != tkAny)
+		TokenMustBe (tok);
 }
 
 // =============================================================================
--- a/src/Lexer.h	Sun Feb 09 15:03:44 2014 +0200
+++ b/src/Lexer.h	Sun Feb 09 15:06:37 2014 +0200
@@ -53,7 +53,7 @@
 
 	void	ProcessFile (String file_name);
 	bool	GetNext (EToken req = tkAny);
-	void	MustGetNext (EToken tok = tkAny);
+	void	MustGetNext (EToken tok);
 	void	MustGetAnyOf (const List<EToken>& toks);
 	int		GetOneSymbol (const StringList& syms);
 	void	TokenMustBe (EToken tok);
--- a/src/Parser.cc	Sun Feb 09 15:03:44 2014 +0200
+++ b/src/Parser.cc	Sun Feb 09 15:06:37 2014 +0200
@@ -374,7 +374,7 @@
 	CheckNotToplevel();
 
 	// Get the name of the label
-	mLexer->MustGetNext();
+	mLexer->MustGetNext (tkAny);
 
 	// Find the mark this goto statement points to
 	String target = GetTokenString();
@@ -492,7 +492,7 @@
 
 	// Initializer
 	mLexer->MustGetNext (tkParenStart);
-	mLexer->MustGetNext();
+	mLexer->MustGetNext (tkAny);
 	DataBuffer* init = ParseStatement();
 
 	if (init == null)
@@ -509,7 +509,7 @@
 	mLexer->MustGetNext (tkSemicolon);
 
 	// Incrementor
-	mLexer->MustGetNext();
+	mLexer->MustGetNext (tkAny);
 	DataBuffer* incr = ParseStatement();
 
 	if (incr == null)
@@ -948,7 +948,7 @@
 		Error ("command call at top level");
 
 	mLexer->MustGetNext (tkParenStart);
-	mLexer->MustGetNext();
+	mLexer->MustGetNext (tkAny);
 
 	int curarg = 0;
 
@@ -969,12 +969,12 @@
 				comm->name, comm->GetSignature());
 
 		r->MergeAndDestroy (ParseExpression (comm->args[curarg].type, true));
-		mLexer->MustGetNext();
+		mLexer->MustGetNext (tkAny);
 
 		if (curarg < comm->minargs - 1)
 		{
 			mLexer->TokenMustBe (tkComma);
-			mLexer->MustGetNext();
+			mLexer->MustGetNext (tkAny);
 		}
 		else if (curarg < comm->args.Size() - 1)
 		{
@@ -987,7 +987,7 @@
 			else
 			{
 				mLexer->TokenMustBe (tkComma);
-				mLexer->MustGetNext();
+				mLexer->MustGetNext (tkAny);
 			}
 		}
 

mercurial