feat: 完善GetPageCss

This commit is contained in:
msojocs 2023-08-20 22:43:47 +08:00
parent e510b1ed6e
commit e627e873ed
3 changed files with 23 additions and 16 deletions

View File

@ -266,9 +266,9 @@ int main(int argc, const char **argv) {
fprintf(stderr, "ERR: %s\nerror file count: %d\n", v90.data(), 0); fprintf(stderr, "ERR: %s\nerror file count: %d\n", v90.data(), 0);
return 1; return 1;
} }
fprintf(f, "%s", v88.data()); fprintf(f, "%s", v101.data());
fclose(f); fclose(f);
// main - 45 // main - 25 - 9
return 0; return 0;
} }
fprintf(stderr, "ERR: wxss GetCompiledResult: %s, error file count: %d, ret %d", v96.data(), lt.offset_4, lt.offset_0); fprintf(stderr, "ERR: wxss GetCompiledResult: %s, error file count: %d, ret %d", v96.data(), lt.offset_4, lt.offset_0);

View File

@ -403,16 +403,21 @@ namespace WXSS
{ {
std::string v30; std::string v30;
auto v23 = this->offset_32; auto v23 = this->offset_32;
if (
this->offset_32[a2]->offset_156.get()
&& this->offset_32[a2]->offset_156->offset_12 != -1
)
{
auto v6 = this->offset_32[a2];
auto v28 = v6->offset_156;
std::stringstream v38;
v38 << "Some selectors are not allowed in component wxss, including tag name selectors, ID selectors, and attribute selectors.(";
v38 << WXML::Rewrite::ToStringCode2(a2);
v38 << ":" << v28->offset_20 << ":" << v28->offset_24 << ")";
v30 = v38.str();
}
std::stringstream v38; std::stringstream v38;
throw "not implement";
// if (
// this->offset_32[a2]->offset_156
// && this->offset_32[a2]->offset_156->offset_12!= -1
// )
// {
// auto v6 = this->offset_32[a2];
// }
v38.clear();
v38 << "setCssToHead(["; v38 << "setCssToHead([";
if (this->offset_128[a2] <= 1) if (this->offset_128[a2] <= 1)
{ {

View File

@ -8305,11 +8305,11 @@ int __thiscall WXSS::XCompiler::GetPageCss(char *this, int *a2, _DWORD *a3, int
v32 = 0; v32 = 0;
if ( *(_DWORD *)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[]( if ( *(_DWORD *)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[](
v23, v23, // this->offset_32
(int)a2) (int)a2)
+ 156) + 156)
&& *(_DWORD *)(*(_DWORD *)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[]( && *(_DWORD *)(*(_DWORD *)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[](
v23, v23, // this->offset_32
(int)a2) (int)a2)
+ 156) + 156)
+ 12) != -1 ) + 12) != -1 )
@ -8330,7 +8330,7 @@ int __thiscall WXSS::XCompiler::GetPageCss(char *this, int *a2, _DWORD *a3, int
v9 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(v28 + 20)); v9 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(v28 + 20));
std::operator<<<std::char_traits<char>>(v9, ":"); std::operator<<<std::char_traits<char>>(v9, ":");
v10 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(v28 + 24)); v10 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(v28 + 24));
std::operator<<<std::char_traits<char>>(v10, (char *)off_50EEF5); std::operator<<<std::char_traits<char>>(v10, (char *)off_50EEF5); // {')','\0',']','\0'}
std::string::_M_dispose((void **)&v35); std::string::_M_dispose((void **)&v35);
std::stringbuf::str((int)&v33, (int)v40); std::stringbuf::str((int)&v33, (int)v40);
std::string::operator=(&v30, &v33); std::string::operator=(&v30, &v33);
@ -8340,11 +8340,13 @@ int __thiscall WXSS::XCompiler::GetPageCss(char *this, int *a2, _DWORD *a3, int
} }
std::basic_stringstream<char,std::char_traits<char>,std::allocator<char>>::basic_stringstream((int)v38); std::basic_stringstream<char,std::char_traits<char>,std::allocator<char>>::basic_stringstream((int)v38);
std::operator<<<std::char_traits<char>>((std::ostream::sentry *)v39, "setCssToHead(["); std::operator<<<std::char_traits<char>>((std::ostream::sentry *)v39, "setCssToHead([");
// this->offset_128
if ( (unsigned int)*std::map<std::string,unsigned int>::operator[]((void **)this + 32, (int)a2) <= 1 ) if ( (unsigned int)*std::map<std::string,unsigned int>::operator[]((void **)this + 32, (int)a2) <= 1 )
{ {
v35 = (int)&v37; // std::string
v36 = 0; v36 = 0;
v35 = (int)&v37;
v37 = 0; v37 = 0;
v15 = std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[](v23, (int)a2); v15 = std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[](v23, (int)a2);
std::__shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree,(__gnu_cxx::_Lock_policy)2>::__shared_ptr(&v33, v15); std::__shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree,(__gnu_cxx::_Lock_policy)2>::__shared_ptr(&v33, v15);
WXSS::XCompiler::GenExpr((int)this, (int)&v33, (int)v38, (WXSS::Token *)&v35); WXSS::XCompiler::GenExpr((int)this, (int)&v33, (int)v38, (WXSS::Token *)&v35);
@ -8382,7 +8384,7 @@ int __thiscall WXSS::XCompiler::GetPageCss(char *this, int *a2, _DWORD *a3, int
std::operator<<<std::char_traits<char>>(v19, "\""); std::operator<<<std::char_traits<char>>(v19, "\"");
std::string::_M_dispose((void **)&v35); std::string::_M_dispose((void **)&v35);
std::operator<<<std::char_traits<char>>((std::ostream::sentry *)v39, "}"); std::operator<<<std::char_traits<char>>((std::ostream::sentry *)v39, "}");
std::operator<<<std::char_traits<char>>((std::ostream::sentry *)v39, (char *)off_50EEF5); std::operator<<<std::char_traits<char>>((std::ostream::sentry *)v39, (char *)off_50EEF5); // ")"
std::stringbuf::str((int)&v35, (int)v40); std::stringbuf::str((int)&v35, (int)v40);
std::string::operator=(a3, &v35); std::string::operator=(a3, &v35);
std::string::_M_dispose((void **)&v35); std::string::_M_dispose((void **)&v35);