Author: silene
Date: Sun Mar 22 19:59:00 2009
New Revision: 34038
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34038&view=rev
Log:
Added support for <<...>> strings in the tokenizer.
Modified:
trunk/src/serialization/tokenizer.hpp
Modified: trunk/src/serialization/tokenizer.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/tokenizer.hpp?rev=34038&r1=34037&r2=34038&view=diff
==============================================================================
--- trunk/src/serialization/tokenizer.hpp (original)
+++ trunk/src/serialization/tokenizer.hpp Sun Mar 22 19:59:00 2009
@@ -93,6 +93,27 @@
switch(current_) {
case EOF:
token_.type = token::END;
+ break;
+ case '<':
+ if (peek_char() != '<') {
+ token_.type = token::MISC;
+ token_.value += current_;
+ break;
+ }
+ token_.type = token::QSTRING;
+ next_char_fast();
+ while (true) {
+ next_char();
+ if(current_ == EOF) {
+ token_.type =
token::UNTERMINATED_QSTRING;
+ break;
+ }
+ if (current_ == '>' &&
peek_char() == '>') {
+ next_char_fast();
+ break;
+ }
+ token_.value += current_;
+ }
break;
case '"':
token_.type = token::QSTRING;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits