scriptreader.cxx

changeset 12
1bdbfcca2fc6
parent 11
f08abacb46c9
child 19
66993500719f
equal deleted inserted replaced
11:f08abacb46c9 12:1bdbfcca2fc6
193 void ScriptReader::ParserMessage (const char* header, char* message) { 193 void ScriptReader::ParserMessage (const char* header, char* message) {
194 fprintf (stderr, "%sIn file %s, at line %u, col %u: %s\n", 194 fprintf (stderr, "%sIn file %s, at line %u, col %u: %s\n",
195 header, filepath.chars(), curline, curchar, message); 195 header, filepath.chars(), curline, curchar, message);
196 } 196 }
197 197
198 // I guess this should be a void function putting the return value into token? 198 void ScriptReader::MustString () {
199 str ScriptReader::MustGetString () {
200 MustNext ("\""); 199 MustNext ("\"");
201 200
202 str string; 201 str string;
203 // Keep reading characters until we find a terminating quote. 202 // Keep reading characters until we find a terminating quote.
204 while (1) { 203 while (1) {
211 break; 210 break;
212 211
213 string += c; 212 string += c;
214 } 213 }
215 214
216 return string; 215 token = string;
217 } 216 }
218 217
219 void ScriptReader::MustNumber () { 218 void ScriptReader::MustNumber () {
220 MustNext (); 219 MustNext ();
221 if (!token.isnumber()) 220 if (!token.isnumber())

mercurial