- fixed: array assignment operators pushed the bytecode parameters the wrong way around...

Wed, 26 Feb 2014 18:31:53 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Wed, 26 Feb 2014 18:31:53 +0200
changeset 114
6cbeb9f8350f
parent 113
4d4c43eca4d7
child 115
9be16e1c1e44

- fixed: array assignment operators pushed the bytecode parameters the wrong way around...

src/Parser.cc file | annotate | diff | comparison | revisions
--- a/src/Parser.cc	Wed Feb 26 07:36:14 2014 +0200
+++ b/src/Parser.cc	Wed Feb 26 18:31:53 2014 +0200
@@ -316,6 +316,7 @@
 					(TokenIs (TK_Str)) ? TYPE_String :
 					TYPE_Bool;
 
+	mLexer->MustGetNext (TK_DollarSign);
 	mLexer->MustGetNext (TK_Symbol);
 	String name = GetTokenString();
 
@@ -1097,6 +1098,9 @@
 	if (mCurrentMode == PARSERMODE_TopLevel)
 		Error ("can't alter variables at top level");
 
+	if (var->isarray)
+		retbuf->MergeAndDestroy (arrayindex);
+
 	// Parse the right operand
 	if (oper != ASSIGNOP_Increase && oper != ASSIGNOP_Decrease)
 	{
@@ -1104,9 +1108,6 @@
 		retbuf->MergeAndDestroy (expr);
 	}
 
-	if (var->isarray)
-		retbuf->MergeAndDestroy (arrayindex);
-
 #if 0
 	// <<= and >>= do not have data headers. Solution: expand them.
 	// a <<= b -> a = a << b

mercurial