fix: import & include

This commit is contained in:
msojocs 2023-07-17 18:05:57 +08:00
parent 867db96d22
commit c1ef6b97cc
4 changed files with 33 additions and 31 deletions

View File

@ -276,7 +276,7 @@ namespace WXML
std::map<std::string, WXML::DOMLib::Token> offset_48; std::map<std::string, WXML::DOMLib::Token> offset_48;
std::vector<std::shared_ptr<WXML::DOMLib::WXMLDom>> offset_72; // std::vector<std::shared_ptr<WXML::DOMLib::WXMLDom>> offset_72; //
WXML::DOMLib::Token offset_84; // token WXML::DOMLib::Token offset_84; // token
StrCache offset_248; std::shared_ptr<StrCache> offset_248;
int offset_256 = 0; // ??? int offset_256 = 0; // ???
std::map<std::string, std::string> offset_272; std::map<std::string, std::string> offset_272;
WXMLDom(/* args */); WXMLDom(/* args */);

View File

@ -310,12 +310,6 @@ namespace WXML{
{ {
std::set<std::string> v328; std::set<std::string> v328;
WXML::DOMLib::recurseDependencies(i->second, i->first, v328); WXML::DOMLib::recurseDependencies(i->second, i->first, v328);
// std::vector<std::string> v278;
// for (auto j = v328.begin(); j != v328.end(); j++)
// {
// v278.push_back(*j);
// }
auto depList = dependencyListMap[i->first]; auto depList = dependencyListMap[i->first];
for (auto j = v328.begin(); j != v328.end(); j++) for (auto j = v328.begin(); j != v328.end(); j++)
{ {
@ -540,22 +534,22 @@ namespace WXML{
} }
// test/wcc.disassembly.cpp line 14346 // test/wcc.disassembly.cpp line 14346
auto v133 = v307_localVecStrMap1[i->first]; auto v133 = v307_localVecStrMap1[i->first];
WXML::DOMLib::StrCache v319; std::shared_ptr<WXML::DOMLib::StrCache> v319(new WXML::DOMLib::StrCache());
for (auto i1 = v133.begin(); i1 != v133.end(); i1++) for (auto i1 = v133.begin(); i1 != v133.end(); i1++)
{ {
v319.Insert(*i1); v319->Insert(*i1);
auto v134 = v304[*i1]; auto v134 = v304[*i1];
v134->offset_248 = v319; v134->offset_248 = v319;
v134->RecordAllPath(); v134->RecordAllPath();
} }
v319.RenderPathDefine(*ss); v319->RenderPathDefine(*ss);
auto v136 = v307_localVecStrMap1[i->first]; auto v136 = v307_localVecStrMap1[i->first];
int v228 = 0; int v228 = 0;
for (auto i2 = v136.begin(); i2 != v136.end(); i2++) for (auto i2 = v136.begin(); i2 != v136.end(); i2++)
{ {
auto v256 = v304[*i2]; auto v256 = v304[*i2];
*ss << dMark << "[x["; *ss << dMark << "[x[";
auto StrID = v319.GetStrID(*i2); auto StrID = v319->GetStrID(*i2);
*ss << StrID << "]]={}" << lineEndMark; *ss << StrID << "]]={}" << lineEndMark;
std::string v140 = v256->offset_272["get_page_z_name"]; std::string v140 = v256->offset_272["get_page_z_name"];
std::map<std::string, std::string> v316; std::map<std::string, std::string> v316;
@ -608,7 +602,7 @@ namespace WXML{
v271 v271
); );
*ss << eMark << "[x["; *ss << eMark << "[x[";
*ss << v319.GetStrID(*i2); *ss << v319->GetStrID(*i2);
*ss << "]]={f:" << v321 << ",j:[],i:[],ti:["; *ss << "]]={f:" << v321 << ",j:[],i:[],ti:[";
std::vector<std::shared_ptr<WXML::DOMLib::WXMLDom>> v146 = v256->offset_72; std::vector<std::shared_ptr<WXML::DOMLib::WXMLDom>> v146 = v256->offset_72;
bool isNeedComma = false; bool isNeedComma = false;
@ -626,7 +620,7 @@ namespace WXML{
} }
*ss << "x["; *ss << "x[";
auto v148 = v211->second.ToAttrContent(); auto v148 = v211->second.ToAttrContent();
*ss << v319.GetStrID(v148); *ss << v319->GetStrID(v148);
*ss << "]"; *ss << "]";
isNeedComma = true; isNeedComma = true;
} }
@ -649,7 +643,7 @@ namespace WXML{
} }
*ss << "x["; *ss << "x[";
std::string v152 = v217->second.ToAttrContent(); std::string v152 = v217->second.ToAttrContent();
*ss << v319.GetStrID(v152); *ss << v319->GetStrID(v152);
*ss << "]"; *ss << "]";
isNeedComma = true; isNeedComma = true;
} }

View File

@ -312,7 +312,7 @@ namespace WXML {
if (a15) if (a15)
{ {
a6 << a12 << "[x["; a6 << a12 << "[x[";
int id = offset_248.GetStrID(a2); int id = offset_248->GetStrID(a2);
a6 << id; a6 << id;
a6 << "]][\""; a6 << "]][\"";
WXML::Rewrite::ToStringCode(a5, a6); WXML::Rewrite::ToStringCode(a5, a6);
@ -336,7 +336,7 @@ namespace WXML {
{ {
a6 << "var " << name; a6 << "var " << name;
a6 << "=x["; a6 << "=x[";
int id = this->offset_248.GetStrID(a2); int id = this->offset_248->GetStrID(a2);
a6 << id << "]"; a6 << id << "]";
a6 << "+':"; a6 << "+':";
WXML::Rewrite::ToStringCode(a5, a6); WXML::Rewrite::ToStringCode(a5, a6);
@ -347,7 +347,7 @@ namespace WXML {
a6 << a13; a6 << a13;
a6 << "if(" << a14 << "[" << name << "]){_wl("; a6 << "if(" << a14 << "[" << name << "]){_wl(";
a6 << name << ",x["; a6 << name << ",x[";
id = this->offset_248.GetStrID(a2); id = this->offset_248->GetStrID(a2);
a6 << id << "]);return}" << a13; a6 << id << "]);return}" << a13;
a6 << a14 << "[" << name << "]=true"; a6 << a14 << "[" << name << "]=true";
@ -580,7 +580,7 @@ namespace WXML {
{ {
a7->GetNextName(v145); a7->GetNextName(v145);
a6 << "var " << v145 << "=" << a3 << "[x["; a6 << "var " << v145 << "=" << a3 << "[x[";
int StrID = this->offset_248.GetStrID(a2); int StrID = this->offset_248->GetStrID(a2);
a6 << StrID << "]].i" << a12; a6 << StrID << "]].i" << a12;
} }
v110++; v110++;
@ -593,7 +593,7 @@ namespace WXML {
{ {
a7->GetNextName(v147); a7->GetNextName(v147);
a6 << "var " << v147 << "=" << a3; a6 << "var " << v147 << "=" << a3;
a6 << "[x[" << this->offset_248.GetStrID(a2) << "]].j" << a12; a6 << "[x[" << this->offset_248->GetStrID(a2) << "]].j" << a12;
} }
} }
} }
@ -715,8 +715,8 @@ namespace WXML {
{ {
a6 << "_ai(" << v145 << ",x["; a6 << "_ai(" << v145 << ",x[";
std::string v66 = srcToken->second.ToAttrContent(); std::string v66 = srcToken->second.ToAttrContent();
int v67 = this->offset_248.GetStrID(v66); int v67 = this->offset_248->GetStrID(v66);
a6 << v67 << "]," << a3 << ",x[" << this->offset_248.GetStrID(a2) << "],"; a6 << v67 << "]," << a3 << ",x[" << this->offset_248->GetStrID(a2) << "],";
a6 << cur->offset_84.offset_8 << "," << cur->offset_84.offset_12 << ")" << a12; a6 << cur->offset_84.offset_8 << "," << cur->offset_84.offset_12 << ")" << a12;
goto LABEL_74; goto LABEL_74;
} }
@ -1169,10 +1169,10 @@ namespace WXML {
a6 << "_ic(x["; a6 << "_ic(x[";
auto srcToken = this->offset_48["src"]; auto srcToken = this->offset_48["src"];
v347 = srcToken.ToAttrContent(); v347 = srcToken.ToAttrContent();
auto strId = this->offset_248.GetStrID(v347); auto strId = this->offset_248->GetStrID(v347);
a6 << strId << "],"; a6 << strId << "],";
a6 << a3 << ",x["; a6 << a3 << ",x[";
a6 << this->offset_248.GetStrID(a2); a6 << this->offset_248->GetStrID(a2);
a6 << "]," << a8 << "," << a9 << "," << a5 << "," << a10 << ");" << a12; a6 << "]," << a8 << "," << a9 << "," << a5 << "," << a10 << ");" << a12;
// goto LABEL_68; // goto LABEL_68;
if (a13 && this->offset_24.size()) if (a13 && this->offset_24.size())
@ -1214,7 +1214,7 @@ namespace WXML {
a7->GetNextName(v336); a7->GetNextName(v336);
a6 << "var " << v336; a6 << "var " << v336;
a6 << "=_gd(x[" << this->offset_248.GetStrID(a2); a6 << "=_gd(x[" << this->offset_248->GetStrID(a2);
a6 << "]," << v333 << "," << a3 << "," << a11 << ")" << a12; a6 << "]," << v333 << "," << a3 << "," << a11 << ")" << a12;
a6 << "if(" << v336 << "){" << a12; a6 << "if(" << v336 << "){" << a12;
@ -1246,7 +1246,7 @@ namespace WXML {
a6 << a10 << ".f=cur_globalf" << a12; a6 << a10 << ".f=cur_globalf" << a12;
a6 << "}" << a12; a6 << "}" << a12;
a6 << "else _w(" << v333 << ",x["; a6 << "else _w(" << v333 << ",x[";
a6 << this->offset_248.GetStrID(a2) << "],"; a6 << this->offset_248->GetStrID(a2) << "],";
a6 << this->offset_48["is"].offset_8 << ","; a6 << this->offset_48["is"].offset_8 << ",";
a6 << this->offset_48["is"].offset_12; a6 << this->offset_48["is"].offset_12;
a6 << ")" << a12; a6 << ")" << a12;
@ -1443,10 +1443,10 @@ namespace WXML {
if (v8) if (v8)
{ {
std::string attr = this->offset_48[v13].ToAttrContent(); std::string attr = this->offset_48[v13].ToAttrContent();
if(!this->offset_248.offset_0.count(attr)) if(!this->offset_248->offset_0.count(attr))
{ {
this->offset_248.offset_0[attr] = this->offset_248.offset_0.size(); this->offset_248->offset_0[attr] = this->offset_248->offset_0.size();
this->offset_248.offset_24.push_back(attr); this->offset_248->offset_24.push_back(attr);
} }
} }
} }

View File

@ -13783,6 +13783,7 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy(
std::_Rb_tree_header::_Rb_tree_header(v314); std::_Rb_tree_header::_Rb_tree_header(v314);
// mark - 20 // mark - 20
// 是否splitedData结尾 // 是否splitedData结尾
// a7.end() != a7.begin()
while ( v238 != lpuexcptb ) while ( v238 != lpuexcptb )
{ {
insert_hint_unique_pos = std::_Rb_tree<std::string,std::string,std::_Identity<std::string>,std::less<std::string>,std::allocator<std::string>> insert_hint_unique_pos = std::_Rb_tree<std::string,std::string,std::_Identity<std::string>,std::less<std::string>,std::allocator<std::string>>
@ -14354,12 +14355,13 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy(
// v248 i->first // v248 i->first
v133 = std::map<std::string,std::vector<std::string>>::operator[](&v307, v248); v133 = std::map<std::string,std::vector<std::string>>::operator[](&v307, v248);
// v307[v248] // v307[v248]
// v245 = v133.end()
v245 = (WXML::NameAllocator *)*((_DWORD *)v133 + 1); v245 = (WXML::NameAllocator *)*((_DWORD *)v133 + 1);
// std::vector<std::string> // std::vector<std::string>
for ( i1 = *(WXML::NameAllocator **)v133; ; i1 = (WXML::NameAllocator *)((char *)i1 + 24) ) for ( i1 = *(WXML::NameAllocator **)v133; ; i1 = (WXML::NameAllocator *)((char *)i1 + 24) )
{ {
v255 = (std::ostream::sentry *)v319; v255 = (std::ostream::sentry *)v319;
if ( i1 == v245 ) if ( i1 == v245 ) // end
break; break;
std::string::basic_string((char *)&jj, (int)i1); std::string::basic_string((char *)&jj, (int)i1);
WXML::DOMLib::StrCache::Insert(v255, (int)&jj); WXML::DOMLib::StrCache::Insert(v255, (int)&jj);
@ -23545,19 +23547,23 @@ int __fastcall WXML::DOMLib::WXMLDom::RecordAllPath(_DWORD *a1)
if ( std::operator==<char>((int)a1, "import") || std::operator==<char>((int)a1, "include") ) if ( std::operator==<char>((int)a1, "import") || std::operator==<char>((int)a1, "include") )
{ {
std::string::basic_string(v13, (char *)off_5539C8); std::string::basic_string(v13, (char *)off_5539C8); // src
// this->offset_48
v8 = std::map<std::string,WXML::DOMLib::Token>::count(a1 + 12, (int)v13); v8 = std::map<std::string,WXML::DOMLib::Token>::count(a1 + 12, (int)v13);
std::string::_M_dispose(v13); std::string::_M_dispose(v13);
if ( v8 ) if ( v8 )
{ {
v9 = (_DWORD *)a1[62]; // this->offset_248 v9 = (_DWORD *)a1[62]; // this->offset_248
std::string::basic_string(v12, (char *)off_5539C8); std::string::basic_string(v12, (char *)off_5539C8); // src
// this->offset_48["src"]
v1 = std::map<std::string,WXML::DOMLib::Token>::operator[](a1 + 12, v12); v1 = std::map<std::string,WXML::DOMLib::Token>::operator[](a1 + 12, v12);
v2 = WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)v1); v2 = WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)v1);
std::string::basic_string((char *)v13, v2); std::string::basic_string((char *)v13, v2);
if ( !std::map<std::string,int>::count(v9, (int)v13) ) if ( !std::map<std::string,int>::count(v9, (int)v13) )
{ {
// v9 = this->offset_248
v7 = v9[5]; // offset_20 v7 = v9[5]; // offset_20
// v7 = this->offset_248->offset_20
*(_DWORD *)std::map<std::string,int>::operator[](v9, (int)v13) = v7; *(_DWORD *)std::map<std::string,int>::operator[](v9, (int)v13) = v7;
std::vector<std::string>::push_back((int)(v9 + 6), (int)v13); std::vector<std::string>::push_back((int)(v9 + 6), (int)v13);
// this->offset_248.offset_24 // this->offset_248.offset_24
@ -23572,7 +23578,9 @@ int __fastcall WXML::DOMLib::WXMLDom::RecordAllPath(_DWORD *a1)
if ( i >= (a1[19] - v3) >> 3 ) if ( i >= (a1[19] - v3) >> 3 )
break; break;
v4 = (volatile signed __int32 **)(*(_DWORD *)(v3 + 8 * i) + 252); v4 = (volatile signed __int32 **)(*(_DWORD *)(v3 + 8 * i) + 252);
// this->offset_248
*(v4 - 1) = (volatile signed __int32 *)a1[62]; *(v4 - 1) = (volatile signed __int32 *)a1[62];
// a1[63] -> this->offset_252
std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(v4, a1[63]); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(v4, a1[63]);
WXML::DOMLib::WXMLDom::RecordAllPath(v5); WXML::DOMLib::WXMLDom::RecordAllPath(v5);
} }