diff --git a/src/include/wxml.h b/src/include/wxml.h index f2da799..94331ad 100644 --- a/src/include/wxml.h +++ b/src/include/wxml.h @@ -262,9 +262,6 @@ namespace WXML 偏移应该不超过0x128u, 296 */ // std::string offset_52; - int offset_104 = 0; // len - int offset_140 = 0; - std::string offset_144; std::string offset_196; std::string offset_220; int offset_244 = 0; diff --git a/src/wxml/compiler.cpp b/src/wxml/compiler.cpp index ecb26ca..ea13cf7 100644 --- a/src/wxml/compiler.cpp +++ b/src/wxml/compiler.cpp @@ -948,6 +948,7 @@ namespace WXML{ a1 = result.str(); } + int RenderDefine_i = 0; int RenderDefine( WXML::DOMLib::WXMLDom & a1, std::string const& a2, @@ -973,6 +974,7 @@ namespace WXML{ { try { + int inner_RenderDefine_i = ++RenderDefine_i; if (a1 == "template") { auto it = a1.offset_48.find("name"); diff --git a/src/wxml/dom_lib/wxml_dom.cpp b/src/wxml/dom_lib/wxml_dom.cpp index e5d32d1..3252f61 100644 --- a/src/wxml/dom_lib/wxml_dom.cpp +++ b/src/wxml/dom_lib/wxml_dom.cpp @@ -57,26 +57,34 @@ namespace WXML { WXML::StringTemplating::Token v85; v85.offset_0 = false; v85.offset_4 = ptm->second; - v77.push_back(v85); - } - std::string v80 = ptm->second; - for (int i = 1; i < v77.size(); i++) - { - WXML::StringTemplating::Token curToken = v77[i]; - if (curToken.offset_0) + + if (v77.begin() != v77.end() && v77[0].offset_0) { - if (!v77[i - 1].offset_0) - { - v77[i - 1].offset_4.append(v80); - } + v77.insert(v77.begin(), v85); } - else if (!curToken.offset_0 && v77[i - 1].offset_0) + if (v77.begin() != v77.end() && v77.back().offset_0) { - curToken.offset_4 = v80 + curToken.offset_4; + v77.push_back(v85); + } + std::string v80 = ptm->second; + for (int i = 1; i < v77.size(); i++) + { + WXML::StringTemplating::Token curToken = v77[i]; + if (curToken.offset_0) + { + if (!v77[i - 1].offset_0) + { + v77[i - 1].offset_4.append(v80); + } + } + else if (v77[i - 1].offset_0) + { + curToken.offset_4 = v80 + curToken.offset_4; + } } } - } + } // end a8 // DealSingleTokenToOps - 15 if (a7) { @@ -844,7 +852,7 @@ namespace WXML { } - // int emplace_back_i = 0; + int RenderNonDefine_i = 0; void WXMLDom::RenderNonDefine( std::string const& a2, std::string const& a3, @@ -862,6 +870,7 @@ namespace WXML { std::map * a15 ) { + int inner_RenderNonDefine_i = ++RenderNonDefine_i; // RenderNonDefine - 0 if (a13 && this->offset_24.size()) { @@ -871,10 +880,10 @@ namespace WXML { } if (this->offset_0 == "TEXTNODE") { - int code = this->offset_140; + int code = this->offset_84.offset_56; if (code == -3) { - std::string ret = this->Error(a2, this->offset_84, "", this->offset_144); + std::string ret = this->Error(a2, this->offset_84, "", this->offset_84.offset_60); throw ret; } if (code == -1) @@ -882,7 +891,7 @@ namespace WXML { std::string ret = this->Error(a2, this->offset_84, "", "value not set"); throw ret; } - a6 << "var " << a5 << "=_oz(z," << this->offset_140; + a6 << "var " << a5 << "=_oz(z," << this->offset_84.offset_56; a6 << "," << a8 << "," << a9 << "," << a10 << ")"; LABEL_69: a6 << a12; @@ -1645,14 +1654,14 @@ namespace WXML { "pos: %d, %d, len: %d, %s", this->offset_84.offset_8, this->offset_84.offset_12, - this->offset_104, + this->offset_84.offset_20, this->offset_84.ToString().data() ); } else { *v4 << "pos: " << this->offset_84.offset_8 - << ", " << this->offset_84.offset_12 << ", len: " << this->offset_104 + << ", " << this->offset_84.offset_12 << ", len: " << this->offset_84.offset_20 << ", "; *v4 << this->offset_84.ToString(); }