mail[Wesnoth-commits] r34037 - /trunk/src/serialization/preprocessor.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on March 22, 2009 - 19:58:
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;




Related Messages


Powered by MHonArc, Updated Sun Mar 22 20:00:30 2009