199 mLexer->MustGetNext (tkSemicolon); |
199 mLexer->MustGetNext (tkSemicolon); |
200 continue; |
200 continue; |
201 } |
201 } |
202 |
202 |
203 // If nothing else, parse it as a statement |
203 // If nothing else, parse it as a statement |
|
204 mLexer->Skip (-1); |
204 DataBuffer* b = ParseStatement(); |
205 DataBuffer* b = ParseStatement(); |
205 |
206 |
206 if (b == false) |
207 if (b == false) |
207 Error ("unknown token `%1`", GetTokenString()); |
208 Error ("unknown token `%1`", GetTokenString()); |
208 |
209 |
372 void BotscriptParser::ParseGoto() |
373 void BotscriptParser::ParseGoto() |
373 { |
374 { |
374 CheckNotToplevel(); |
375 CheckNotToplevel(); |
375 |
376 |
376 // Get the name of the label |
377 // Get the name of the label |
377 mLexer->MustGetNext (tkAny); |
378 mLexer->MustGetNext (tkSymbol); |
378 |
379 |
379 // Find the mark this goto statement points to |
380 // Find the mark this goto statement points to |
380 String target = GetTokenString(); |
381 String target = GetTokenString(); |
381 ByteMark* mark = buffer()->FindMarkByName (target); |
382 ByteMark* mark = buffer()->FindMarkByName (target); |
382 |
383 |
1190 // ============================================================================ |
1189 // ============================================================================ |
1191 // |
1190 // |
1192 DataBuffer* BotscriptParser::ParseStatement() |
1191 DataBuffer* BotscriptParser::ParseStatement() |
1193 { |
1192 { |
1194 // If it's a variable, expect assignment. |
1193 // If it's a variable, expect assignment. |
1195 if (TokenIs (tkDollarSign)) |
1194 if (mLexer->GetNext (tkDollarSign)) |
1196 { |
1195 { |
1197 mLexer->MustGetNext (tkSymbol); |
1196 mLexer->MustGetNext (tkSymbol); |
1198 ScriptVariable* var = FindGlobalVariable (GetTokenString()); |
1197 ScriptVariable* var = FindGlobalVariable (GetTokenString()); |
1199 |
1198 |
1200 if (var == null) |
1199 if (var == null) |