Author: silene
Date: Sun Mar 22 19:58:54 2009
New Revision: 34037
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34037&view=rev
Log:
Added '<<' and '>>' as stronger quotes for avoiding preprocessing some strings.
Modified:
trunk/src/serialization/preprocessor.cpp
Modified: trunk/src/serialization/preprocessor.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/preprocessor.cpp?rev=34037&r1=34036&r2=34037&view=diff
==============================================================================
--- trunk/src/serialization/preprocessor.cpp (original)
+++ trunk/src/serialization/preprocessor.cpp Sun Mar 22 19:58:54 2009
@@ -351,6 +351,7 @@
* - 'I': skipping the "if" branch of a ifdef/ifndef (the
"else" branch, if any, will be processed)
* - 'J': skipping the "else" branch of a ifdef/ifndef
* - '"': processing a string
+ * - '<': processing a verbatim string
* - '{': processing between chunks of a macro call (skip
spaces)
* - '[': processing inside a chunk of a macro call (stop on
space or '(')
* - '(': processing a parenthesized macro argument
@@ -635,6 +636,22 @@
buffer += '\n';
// line_change = 1-1 = 0
put(buffer);
+ } else if (token.type == '<') {
+ put(c);
+ if (c == '>' && in_->peek() == '>') {
+ put(in_->get());
+ if (!skipping_ && slowpath_) {
+ std::string tmp = strings_.back();
+ pop_token();
+ strings_.back() += tmp;
+ } else
+ pop_token();
+ }
+ } else if (c == '<' && in_->peek() == '<') {
+ in_->get();
+ push_token('<');
+ put('<');
+ put('<');
} else if (c == '"') {
if (token.type == '"') {
target_.quoted_ = false;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits