scriptreader.cxx

changeset 35
3d3f6ed40171
parent 34
0a9a5902beaa
child 36
a8838b5f1213
--- a/scriptreader.cxx	Sat Jul 28 17:41:24 2012 +0300
+++ b/scriptreader.cxx	Sat Jul 28 17:57:37 2012 +0300
@@ -356,9 +356,10 @@
 	token = string;
 }
 
-void ScriptReader::MustNumber () {
+void ScriptReader::MustNumber (bool fromthis) {
 	str num;
-	MustNext ();
+	if (!fromthis)
+		MustNext ();
 	num += token;
 	
 	// Cater for a possible minus sign, since it
@@ -370,6 +371,8 @@
 	
 	if (!num.isnumber())
 		ParserError ("expected a number, got `%s`", num.chars());
+	
+	token = num;
 }
 
 void ScriptReader::MustBool () {

mercurial