fix: 一些错误

This commit is contained in:
msojocs 2023-08-21 22:26:05 +08:00
parent e627e873ed
commit 53d8ceacf0
8 changed files with 51 additions and 13 deletions

View File

@ -27,7 +27,7 @@ namespace WXSS
size: 92
*/
public:
int offset_0 = 0;
int offset_0 = 1;
std::shared_ptr<std::string> offset_4;
int offset_12 = 0;
int offset_16 = 0;
@ -130,20 +130,21 @@ namespace WXSS
public:
std::string offset_0;
WXSS::Token offset_24;
int offset_116; // 类型未确定
int offset_116 = 1; // 类型未确定
std::vector<std::shared_ptr<CSSSyntaxTree>> offset_120;
std::shared_ptr<std::string> offset_132; // 类型未确定,不是布尔值
std::shared_ptr<std::string> offset_140;
std::shared_ptr<std::string[3]> offset_148;
std::shared_ptr<Token> offset_156;
int offset_164;
int offset_168;
int offset_172; // 类型未确定
int offset_164 = 0;
int offset_168 = 0;
int offset_172 = 0; // 类型未确定
CSSSyntaxTree(/* args */);
~CSSSyntaxTree();
void GetHostRule(std::string &);
void Print2Stream(int, std::stringstream &);
void RenderCode(std::string &,bool);
CSSSyntaxTree& operator=(CSSSyntaxTree&);
};
class Rule
{

View File

@ -65,7 +65,7 @@ int main(int argc, const char **argv) {
bool v36 = false;
bool v37 = false;
std::string fileName;
std::string v76;
std::string v76 = "./app.wxss";
for (int i = 0; i < v69.size(); i++) {
std::string cur = v69[i];
if (cur[0] != '-')
@ -175,7 +175,7 @@ int main(int argc, const char **argv) {
v101.append("./", 2);
v101.append(v69[i + 1]);
// TODO... 待检验
v76 = v101;
v76 = v101.append("/app.wxss");
}
}
// main - 20

View File

@ -8,6 +8,7 @@ namespace WXSS
{
CSSSyntaxTree::CSSSyntaxTree(/* args */)
{
this->offset_24.offset_0 = 1;
}
CSSSyntaxTree::~CSSSyntaxTree()
@ -140,6 +141,22 @@ namespace WXSS
}
}
CSSSyntaxTree& CSSSyntaxTree::operator=(CSSSyntaxTree& old)
{
this->offset_0 = old.offset_0;
this->offset_24 = old.offset_24;
this->offset_116 = old.offset_116;
this->offset_120 = old.offset_120;
this->offset_132 = old.offset_132;
this->offset_140 = old.offset_140;
this->offset_148 = old.offset_148;
this->offset_156 = old.offset_156;
this->offset_164 = old.offset_164;
this->offset_168 = old.offset_168;
this->offset_172 = old.offset_172;
return *this;
}
}
} // namespace WXSS

View File

@ -252,6 +252,10 @@ namespace WXSS
}
return 0;
}
int off_519B00(std::shared_ptr<WXSS::CSSTreeLib::Rule>& a1, std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> &a2)
{
throw "not implement";
}
int off_519B40(std::shared_ptr<WXSS::CSSTreeLib::Rule>& a1, std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> &a2)
{
// WXSS::CSSTreeLib::AndRules::MarkGood
@ -402,7 +406,7 @@ namespace WXSS
v69->offset_4_vecPair.emplace_back("SELECTOR", v77);
std::shared_ptr<WXSS::CSSTreeLib::Rule> v79(new WXSS::CSSTreeLib::Rule());
v79->offset_0 = off_519B84;
v79->offset_0 = off_519B00;
v77->offset_4_vecPair.emplace_back("$NAME", v79);
// Init - 30
std::shared_ptr<WXSS::CSSTreeLib::Rule> v81(new WXSS::CSSTreeLib::Rule());

View File

@ -23,7 +23,7 @@ namespace WXSS
result = "UNKNOWN";
if (this->offset_4.get())
{
return *this->offset_4.get();
return *this->offset_4;
}
}
return result;

View File

@ -84,8 +84,8 @@ namespace WXSS
}
}
std::string v74 = v42;
std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> v75(new WXSS::CSSTreeLib::CSSSyntaxTree());
this->offset_32[v74] = v75;
this->offset_32[v74] = v29.offset_0;
}
}
// end for
@ -502,7 +502,7 @@ namespace WXSS
this->offset_152[j->first] = j->first;
}
}
for (auto k = this->offset_32.rbegin(); k != this->offset_32.rend(); k++)
for (auto k = this->offset_32.begin(); k != this->offset_32.end(); k++)
{
if (this->offset_128[k->first] > 1)
{

View File

@ -45132,7 +45132,7 @@ int __fastcall WXSS::CSSTreeLib::CSSSyntaxTree::CSSSyntaxTree(int a1)
*(_DWORD *)(a1 + 28) = 0;
*(_DWORD *)(a1 + 32) = 0;
*(_BYTE *)(a1 + 52) = 0;
*(_DWORD *)(a1 + 24) = 1;
*(_DWORD *)(a1 + 24) = 1; // this->offset_24
*(_DWORD *)(a1 + 36) = 0;
*(_DWORD *)(a1 + 40) = 0;
*(_DWORD *)(a1 + 44) = 0;

16
test/wcsc.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
root_dir=$(cd `dirname $0`/.. && pwd -P)
cd /mnt/d/Work/WeChatProjects/miniprogram-demo/miniprogram
# list="cmd1 cmd2"
# for cmd in $list;
# do
# echo $cmd
# /root/github/wx-compiler/build/wcc "--config-path" "/mnt/d/Work/disassembly/wcc-exec/wcc/config/$cmd.txt" > /root/github/wx-compiler/test/wcc_linux.json
# /mnt/d/Work/disassembly/wcc-exec/wcc/wcc.exe "--config-path" "d:/Work/disassembly/wcc-exec/wcc/config/$cmd.txt" > /root/github/wx-compiler/test/wcc_win.json
# done;
filename="ll1.txt"
/root/github/wx-compiler/build/wcsc "--config-path" "/mnt/d/Work/disassembly/wcc-exec/wcsc/config/$filename" > /root/github/wx-compiler/test/wcsc_linux.json
/mnt/d/Work/disassembly/wcc-exec/wcsc/wcsc.exe "--config-path" "d:/Work/disassembly/wcc-exec/wcsc/config/$filename" > /root/github/wx-compiler/test/wcsc_win.json