diff --git a/src/wcsc.cpp b/src/wcsc.cpp index 2c9a85c..d9e9e66 100644 --- a/src/wcsc.cpp +++ b/src/wcsc.cpp @@ -266,9 +266,9 @@ int main(int argc, const char **argv) { fprintf(stderr, "ERR: %s\nerror file count: %d\n", v90.data(), 0); return 1; } - fprintf(f, "%s", v88.data()); + fprintf(f, "%s", v101.data()); fclose(f); - // main - 45 + // main - 25 - 9 return 0; } fprintf(stderr, "ERR: wxss GetCompiledResult: %s, error file count: %d, ret %d", v96.data(), lt.offset_4, lt.offset_0); diff --git a/src/wxss/x_compiler.cpp b/src/wxss/x_compiler.cpp index 680a0b6..3935e30 100644 --- a/src/wxss/x_compiler.cpp +++ b/src/wxss/x_compiler.cpp @@ -403,16 +403,21 @@ namespace WXSS { std::string v30; 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; - 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(["; if (this->offset_128[a2] <= 1) { diff --git a/test/wcsc.disassembly.cpp b/test/wcsc.disassembly.cpp index 22e30e3..382e9eb 100644 --- a/test/wcsc.disassembly.cpp +++ b/test/wcsc.disassembly.cpp @@ -8305,11 +8305,11 @@ int __thiscall WXSS::XCompiler::GetPageCss(char *this, int *a2, _DWORD *a3, int v32 = 0; if ( *(_DWORD *)(*(_DWORD *)std::map>::operator[]( - v23, + v23, // this->offset_32 (int)a2) + 156) && *(_DWORD *)(*(_DWORD *)(*(_DWORD *)std::map>::operator[]( - v23, + v23, // this->offset_32 (int)a2) + 156) + 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)); std::operator<<>(v9, ":"); v10 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(v28 + 24)); - std::operator<<>(v10, (char *)off_50EEF5); + std::operator<<>(v10, (char *)off_50EEF5); // {')','\0',']','\0'} std::string::_M_dispose((void **)&v35); std::stringbuf::str((int)&v33, (int)v40); std::string::operator=(&v30, &v33); @@ -8340,11 +8340,13 @@ int __thiscall WXSS::XCompiler::GetPageCss(char *this, int *a2, _DWORD *a3, int } std::basic_stringstream,std::allocator>::basic_stringstream((int)v38); std::operator<<>((std::ostream::sentry *)v39, "setCssToHead(["); + // this->offset_128 if ( (unsigned int)*std::map::operator[]((void **)this + 32, (int)a2) <= 1 ) { + v35 = (int)&v37; // std::string v36 = 0; - v35 = (int)&v37; v37 = 0; + v15 = std::map>::operator[](v23, (int)a2); std::__shared_ptr::__shared_ptr(&v33, v15); 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<<>(v19, "\""); std::string::_M_dispose((void **)&v35); std::operator<<>((std::ostream::sentry *)v39, "}"); - std::operator<<>((std::ostream::sentry *)v39, (char *)off_50EEF5); + std::operator<<>((std::ostream::sentry *)v39, (char *)off_50EEF5); // ")" std::stringbuf::str((int)&v35, (int)v40); std::string::operator=(a3, &v35); std::string::_M_dispose((void **)&v35);