fix: 修复一些错误

This commit is contained in:
msojocs 2023-07-14 23:22:36 +08:00
parent 9cc0ee2e3c
commit 57f28cca62
6 changed files with 70 additions and 60 deletions

View File

@ -150,10 +150,11 @@ namespace WXML {
a3 << "undefined";
break;
}
WXML::EXPRLib::ExprSyntaxTree v70;
v70.offset_0 = v85;
// WXML::EXPRLib::ExprSyntaxTree v70;
// v70.offset_0 = vp.offset_80->offset_0;
// v70.offset_52.push_back();
// v70.offset_0 = v77[i].offset_4;
v70.RenderAsOps(a3, v85, v77_b);
vp.offset_80->RenderAsOps(a3, v85, v77_b);
}
else
{

View File

@ -19,10 +19,12 @@ namespace WXML
if (a2 == "false")
{
a1 << WXML::EXPRLib::OPShort::CONST << ",false";
return;
}
if (a2 != "$global")
{
a1 << WXML::EXPRLib::OPShort::NAME << ",'" << a2 << "'";
return;
}
a1 << WXML::EXPRLib::OPShort::CS_GLOBAL;
}

View File

@ -33,7 +33,8 @@ namespace WXML
{
a2 << WXML::EXPRLib::OPShort::CONST << ",'";
std::string v6 = this->offset_24.GetLiteral();
// WXML::Rewrite::ToStringCode(v6.size(), ,a2);
// this->off
WXML::Rewrite::ToStringCode(v6.data() + 1, v6.length() - 2,a2);
const char off_5542FA[] = {'\'','\0','[','\0'};
a2 << off_5542FA;
}
@ -57,26 +58,26 @@ namespace WXML
{
if (this->offset_0 == "OP_PATH")
{
// if (this->offset_52.size() != 1)
// {
// a2 << "]";
// return;
// }
if (this->offset_52.size() != 1)
{
a2 << "]";
return;
}
a2 << "[" << WXML::EXPRLib::OPShort::GET_FROM_ENV << "],";
WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
this->offset_52[0]->RenderAsOps(a2, a3, a4);
a2 << "]";
return;
}
if (this->offset_0 == "OP_LIST")
{
a2 << "[" << WXML::EXPRLib::OPShort::MAKE_LIST << "],";
// if (this->offset_52.size() == 0)
// {
// a2 << "]";
// return;
// }
WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
if (this->offset_52.size() == 0)
{
a2 << "]";
return;
}
this->offset_52[0]->RenderAsOps(a2, a3, a4);
a2 << "]";
return;
@ -84,45 +85,46 @@ namespace WXML
if (this->offset_0 == "OP_LIST_CONCAT")
{
a2 << "[" << WXML::EXPRLib::OPShort::CON_LIST << "]";
// for (int i = 0; i < this->offset_52.size(); i++)
// {
// a2 << ",";
// WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
// }
for (int i = 0; i < this->offset_52.size(); i++)
{
a2 << ",";
this->offset_52[i]->RenderAsOps(a2, a3, a4);
}
}
else if (this->offset_0 == "OP_DICT_CONCAT")
{
a2 << "[" << WXML::EXPRLib::OPShort::UNION_KV << "]";
// for (int i = 0; i < this->offset_52.size(); i++)
// {
// a2 << ",";
// WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
// }
for (int i = 0; i < this->offset_52.size(); i++)
{
a2 << ",";
this->offset_52[i]->RenderAsOps(a2, a3, a4);
}
}
else if (this->offset_0 == "OP_MAKE_DICT")
{
a2 << "[" << WXML::EXPRLib::OPShort::MAKE_KV << "],'";
// this->offset_52.offset_24;
// a2 << ;
a2 << "',";
// if (this->offset_52.size() == 0)
// {
// a2 << "[" << "[7],";
// WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
// a2 << "]";
// }
// else
// {
// WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
// }
const char off_5542FA[] = {'\'','\0','[','\0'};
a2 << off_5542FA;
std::string v18 = this->offset_52[0]->offset_24.GetLiteral();
a2 << v18 << "',";
if (this->offset_52.size() <= 1)
{
a2 << "[" << "[7],";
this->offset_52[0]->RenderAsOps(a2, a3, a4);
a2 << "]";
}
else
{
this->offset_52[0]->RenderAsOps(a2, a3, a4);
}
}
else
{
if (this->offset_0 == "OP_EXPAND")
{
a2 << "[" << WXML::EXPRLib::OPShort::EX_DICT << "],";
WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
this->offset_52[0]->RenderAsOps(a2, a3, a4);
a2 << "]";
return;
@ -131,22 +133,22 @@ namespace WXML
if (this->offset_0 == "OP_DICT")
{
a2 << "[" << WXML::EXPRLib::OPShort::GET_NAME << "]";
// for (int i = 0; i < this->offset_52.size(); i++)
// {
// a2 << ",";
// WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
for (int i = 0; i < this->offset_52.size(); i++)
{
a2 << ",";
this->offset_52[i]->RenderAsOps(a2, a3, a4);
// }
}
}
else if (this->offset_0 == "OP_FUNC")
{
a2 << "[" << WXML::EXPRLib::OPShort::DO_FUNC << "]";
// for (int i = 0; i < this->offset_52.size(); i++)
// {
// a2 << ",";
// WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
for (int i = 0; i < this->offset_52.size(); i++)
{
a2 << ",";
this->offset_52[i]->RenderAsOps(a2, a3, a4);
// }
}
}
}
@ -157,14 +159,14 @@ namespace WXML
{
a2 << "[" << WXML::EXPRLib::OPShort::AOP;
a2 << ",'" << this->offset_0 << "'],";
// for (int i = 0; i < this->offset_52.size(); i++)
// {
// if (i)
// {
// a2 << ",";
// }
// WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4);
// }
for (int i = 0; i < this->offset_52.size(); i++)
{
if (i)
{
a2 << ",";
}
this->offset_52[i]->RenderAsOps(a2, a3, a4);
}
}
// RenderAsOps - 15

View File

@ -109,6 +109,7 @@ namespace WXML
std::string v18 = v84.GetTokenName();
v80->offset_0 = v18;
v80->offset_24 = v84;
this->offset_40.push_back(v80);
}
@ -140,7 +141,6 @@ namespace WXML
return 1002;
}
auto v21 = this->offset_40.back();
this->offset_40.pop_back();
this->offset_40.push_back(v78);
}

View File

@ -7,7 +7,7 @@ namespace WXML {
{
void ToStringCode(char const* src, int len, std::stringstream &ss)
{
for (size_t i = 0; i < len; i++)
for (int i = 0; i < len; i++)
{
char v4 = src[i];
if ( v4 == '\''/*39*/ )

View File

@ -27791,8 +27791,13 @@ int __thiscall WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(int *this, int a2, int
{
v5 = std::operator<<<std::char_traits<char>>(v44, WXML::EXPRLib::OPShort::CONST);
std::operator<<<std::char_traits<char>>(v5, ",'");
// this[9] -> this->offset_24->offset_12 -> v6
// +4 -> length
lpuexcpta = (struct _Unwind_Exception *)(*(_DWORD *)(this[9] + 4) - 2);
v6 = WXML::EXPRLib::Token::GetLiteral(v37);
/**
* a2 stringstream
*/
WXML::Rewrite::ToStringCode((int)(v6 + 1), (int)lpuexcpta, a2);
std::operator<<<std::char_traits<char>>(v44, (char *)off_5542FA);
}