From 54d1f1068e3cbc7b0563b36c0385ac8c706e859e Mon Sep 17 00:00:00 2001 From: msojocs Date: Thu, 6 Jul 2023 21:13:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A0=86?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 14 + src/include/night.h | 275 +++++++++++ src/include/wxml.h | 52 ++- src/night/night.cpp | 79 ++++ src/night/ns_ast_parse.cpp | 41 ++ src/night/ns_compile_js.cpp | 285 ++++++++++++ src/night/ns_god/ns_god.cpp | 34 ++ src/night/ns_node.cpp | 19 + src/night/ns_sourcemap.cpp | 13 + src/night/ns_stream.cpp | 45 ++ src/night/ns_token.cpp | 20 + src/night/sourcemap/sourcemap.cpp | 23 + src/night/str/str.cpp | 16 + src/wcc.cpp | 2 +- src/wxml/compiler.cpp | 134 ++++-- src/wxml/dom_lib/common.cpp | 12 + src/wxml/dom_lib/rvm_op_code_position.cpp | 4 + src/wxml/dom_lib/str_cache.cpp | 22 +- src/wxml/dom_lib/wxml_dom.cpp | 529 +++++++++++++++++++++- src/wxml/expr_lib/expr_syntax_tree.cpp | 26 ++ src/wxml/expr_lib/parser.cpp | 26 ++ src/wxml/string_templating/common.cpp | 131 +++++- test/wcc.disassembly.cpp | 304 ++++++++----- test/wcc.sh | 4 + 24 files changed, 1914 insertions(+), 196 deletions(-) create mode 100644 src/include/night.h create mode 100644 src/night/night.cpp create mode 100644 src/night/ns_ast_parse.cpp create mode 100644 src/night/ns_compile_js.cpp create mode 100644 src/night/ns_god/ns_god.cpp create mode 100644 src/night/ns_node.cpp create mode 100644 src/night/ns_sourcemap.cpp create mode 100644 src/night/ns_stream.cpp create mode 100644 src/night/ns_token.cpp create mode 100644 src/night/sourcemap/sourcemap.cpp create mode 100644 src/night/str/str.cpp create mode 100644 src/wxml/expr_lib/expr_syntax_tree.cpp create mode 100644 src/wxml/expr_lib/parser.cpp create mode 100644 test/wcc.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index af6b31f..2e4a6b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,17 +7,31 @@ enable_testing() add_executable(wcc src/wcc.cpp src/include/wxml.h + src/include/night.h src/wcc/usage.cpp src/wxa/wxa.cpp src/wxml/rewrite.cpp src/wxml/name_allocator.cpp + src/wxml/string_templating/common.cpp src/wxml/string_templating/token.cpp + src/wxml/dom_lib/rvm_op_code_position_recorder.cpp + src/wxml/dom_lib/rvm_op_code_position.cpp src/wxml/dom_lib/parse_exception.cpp src/wxml/dom_lib/token.cpp src/wxml/dom_lib/common.cpp src/wxml/dom_lib/machine.cpp src/wxml/dom_lib/tokenizer.cpp src/wxml/dom_lib/parser.cpp + src/night/night.cpp + src/night/ns_ast_parse.cpp + src/night/ns_compile_js.cpp + src/night/ns_node.cpp + src/night/ns_sourcemap.cpp + src/night/ns_stream.cpp + src/night/ns_token.cpp + src/night/ns_god/ns_god.cpp + src/wxml/expr_lib/parser.cpp + src/wxml/expr_lib/expr_syntax_tree.cpp src/wxml/compiler.cpp src/wxml/dom_lib/str_cache.cpp src/wxml/dom_lib/wxml_dom.cpp diff --git a/src/include/night.h b/src/include/night.h new file mode 100644 index 0000000..bf95a13 --- /dev/null +++ b/src/include/night.h @@ -0,0 +1,275 @@ +#ifndef __NIGHT_H__ +#define __NIGHT_H__ + +#include +#include +#include + +namespace night +{ + extern std::string NS_TYPE_BOOL; + extern std::string NS_TYPE_VAR; + extern std::string NS_TYPE_NUM; + extern std::string NS_TYPE_B_TYPE; + extern std::string NS_TYPE_OP_SELF; + extern std::string NS_TYPE_BINARY; + extern std::string NS_TYPE_ASSIGN; + extern std::string NS_TYPE_TERNARY; + extern std::string NS_TYPE_OBJ_DOT; + extern std::string NS_TYPE_OBJ_PROPERTY; + extern std::string NS_TYPE_OBJ_SELF_OP; + extern std::string NS_TYPE_OBJ_BLOCK; + extern std::string NS_TYPE_BRACKET; + extern std::string NS_TYPE_CALL; + extern std::string NS_TYPE_KW; + extern std::string NS_TYPE_SKIP; + extern std::string NS_TYPE_STR; + extern std::string NS_TYPE_PUNC; + extern std::string NS_TYPE_FUNC; + extern std::string NS_TYPE_PROG; + extern std::string NS_TYPE_PROG_NO_SEM; + extern std::string NS_TYPE_PROG_NO_SEM_REQUIRE; + extern std::string NS_TYPE_ARRAY; + extern std::string NS_TYPE_SWITCH; + extern std::string NS_TYPE_DO_WHILE; + extern std::string NS_TYPE_WHILE; + extern std::string NS_TYPE_FOR; + extern std::string NS_TYPE_IF; + extern std::string NS_TYPE_K_V; + + extern std::string std_v_n; + extern std::string std_v_v_n; + + void compile_ns(std::string const&,std::string const&,std::string const&,uint,std::string&,bool); + void compile_ns_with_sourcemap(std::string const&,std::string const&,std::string const&,std::string const&,uint,std::string&,std::string&); + void readfile(char const*, std::string &); + void writefile(char const*, std::string &); + + class NSGod + { + private: + /* data */ + public: + NSGod(/* args */); + ~NSGod(); + void gen_girl(std::string); + void gen_son(std::string); + void hamlet(void); + }; + + class ns_node + { + private: + /* data */ + public: + std::string offset_0; + std::string offset_24; + std::string offset_60; + std::string offset_108; + std::string offset_156; + night::ns_node * offset_180; + night::ns_node * offset_184; + night::ns_node * offset_192; + std::vector offset_196; + std::vector offset_228; + ns_node(/* args */); + ~ns_node(); + std::string debug_no_space(void); + }; + + class NSToken + { + private: + /* data */ + public: + NSToken(/* args */); + ~NSToken(); + bool eof(void); + void err(std::string const&,int,int,bool); + void get_tokens_for_sourcemap(std::map &, std::map &); + void next(void); + void pass(void); + void peek(void); + void push(night::ns_node *); + void read_comment_method_1(void); + void read_comment_method_2(void); + void read_next(void); + void read_number(std::string const&); + void read_string(char,std::string const&); + void read_var(std::string const&); + std::string read_while(bool (*)(char,void *),void *); + void rw_cb_number(char,void *); + void skip_comment(std::string &); + void tk_is_comment2(char,void *); + void tk_is_not_line_break(char,void *); + void tk_is_valid_op_str(char,void *); + void tk_is_var(char,void *); + void tk_is_var_start(char,void *); + void tk_is_whitespace(char,void *); + }; + + class NSASTParse + { + private: + /* data */ + std::string offset_0; + night::NSGod * offset_24; + night::NSToken * offset_28; + int offset_36; + int offset_40; + std::string offset_44; + int offset_52; + public: + NSASTParse(/* args */); + NSASTParse(std::string, night::NSToken *, night::NSGod *); + ~NSASTParse(); + void ast_call(night::ns_node *); + void ast_code_block(void); + void ast_dispatch(bool); + void ast_do_while(void); + void ast_expression(void); + void ast_expression_no_binary(void); + void ast_expression_no_comma(void); + void ast_for(void); + void ast_function(void); + void ast_if(void); + void ast_new_array(void); + void ast_obj_block(void); + void ast_obj_dot(night::ns_node *); + void ast_obj_op(night::ns_node *); + void ast_obj_op_self(night::ns_node *); + void ast_op_self(void); + void ast_require(void); + void ast_switch(void); + void ast_ternary_expression(void); + void ast_trans_kw(void); + void ast_var(void); + void ast_varname(void); + void ast_while(void); + void end_line(void); + void ignore_buildin_kw(std::string const&); + void ignore_op(std::string const&); + void ignore_punc(std::string const&); + void ignore_punc_pass_sem(std::string const&); + void is_buildin_keywords(std::string const&); + void is_exp(night::ns_node *); + void is_obj_op_self(bool); + void is_op(std::string const&); + + /** + * 是 op操作符 或者是 comma逗号 + */ + void is_op_or_comma(std::string const&); + + void is_op_self(bool); + + /** + * 是否是标点符号(punctuation) + */ + void is_punctuation(std::string const&); + void is_save_for_division(night::ns_node *); + void make_binary_or_just_value(night::ns_node *,bool); + void make_call_or_just_expression(night::ns_node *); + void make_list_by_parser( + std::string const&, + std::string const&, + std::string const&, + std::string const&, + bool, + int, + std::string + ); + void top_down(void); + }; + + class ns_sourcemap + { + private: + /* data */ + public: + std::string offset_0; + ns_sourcemap(/* args */); + ~ns_sourcemap(); + }; + + class NSCompileJs + { + private: + /* data */ + night::NSASTParse * offset_24; + std::vector * offset_28; + public: + std::string offset_0; + std::vector offset_36; + int offset_48; + NSCompileJs(/* args */); + ~NSCompileJs(); + std::string compile(night::ns_node *); + std::string compile_assign(night::ns_node *); + std::string compile_binary(night::ns_node *); + std::string compile_call(night::ns_node *); + std::string compile_do_while(night::ns_node *); + std::string compile_for(night::ns_node *); + std::string compile_function(night::ns_node *); + std::string compile_if(night::ns_node *); + std::string compile_k_v(night::ns_node *); + std::string compile_obj_dot(night::ns_node *); + std::string compile_obj_property(night::ns_node *); + std::string compile_obj_self_op(night::ns_node *); + void compile_once(std::string &, std::vector *, bool); + std::string compile_op_self(night::ns_node *); + std::string compile_prog(night::ns_node *); + std::string compile_prog_no_sem(night::ns_node *); + std::string compile_switch(night::ns_node *); + std::string compile_ternary(night::ns_node *); + std::string compile_var(night::ns_node *); + std::string compile_while(night::ns_node *); + }; + + class NSStream + { + private: + /* data */ + std::string offset_24; + int offset_48 = 0; + int offset_52 = 0; // 当前行数 + int offset_56 = 0; // 当前行第几个字符位置 + public: + NSStream(/* args */); + NSStream(std::string const&,std::string const&,uint); + ~NSStream(); + void eof(void); + void eof_2(void); + void err(std::string const&,int,int,bool); + void next(void); + void peek(void); + void peek_2(void); + }; + + namespace str + { + void get_token(std::string const&, int); + void path_combine( + std::string const&, + std::string const&, + std::string& + ); + } // namespace str + + namespace sourcemap + { + void gen_sourcemap_content( + std::string const&, + std::map, + std::map, + std::vector &, + int, + std::string&, + std::string* + ); + void int2vlq(int); + } // namespace sourcemap + +} // namespace night + +#endif diff --git a/src/include/wxml.h b/src/include/wxml.h index 553c0f0..46ccd15 100644 --- a/src/include/wxml.h +++ b/src/include/wxml.h @@ -46,12 +46,14 @@ namespace WXML private: /* data */ public: + bool offset_0; + std::string offset_4; Token(/* args */); ~Token(); }; - void Deal( + int Deal( char const*, std::string &, std::vector &, @@ -89,7 +91,8 @@ namespace WXML int offset_24 = 0; // ??? int offset_40 = 0; // AttrsCompartor用到,怎么来不知道 // int offset_48 = 0; - int offset_56 = 0; // ??? -3, -1 + // ??? -3, -1 + int offset_56 = 0; std::string offset_60 = ""; // ??? Token(); Token(std::string &); @@ -152,6 +155,7 @@ namespace WXML */ std::string resolvePath(std::string const& path1, std::string const& path2); + std::string removern(std::string const&); /** * @@ -217,8 +221,9 @@ namespace WXML { private: /* data */ - std::map d; - std::vector offset_6; + std::map offset_0; + int offset_20 = 0; + std::vector offset_24; public: StrCache(/* args */); ~StrCache(); @@ -232,6 +237,9 @@ namespace WXML private: /* data */ public: + std::string offset_0; + int offset_4; + RVMOpCodePosition(std::string); RVMOpCodePosition(/* args */); ~RVMOpCodePosition(); }; @@ -240,6 +248,8 @@ namespace WXML private: /* data */ public: + int offset_0 = 0; + int offset_4 = 0; RVMOpCodePositionRecorder(/* args */); ~RVMOpCodePositionRecorder(); }; @@ -352,6 +362,18 @@ namespace WXML WXML::DOMLib::RVMOpCodePositionRecorder *, bool, const std::map &); + int DealSingleTokenToOps( + std::string const&, + std::string&, + std::stringstream &, + std::map &, + WXML::DOMLib::Token *, + bool, + int, + bool, + WXML::DOMLib::RVMOpCodePositionRecorder *, + bool, + const std::map &); }; @@ -501,6 +523,23 @@ namespace WXML namespace EXPRLib { + class Parser + { + private: + /* data */ + public: + Parser(/* args */); + ~Parser(); + int Parse( + std::string const& a2, + std::string const& a3, + int a4, + int a5, + std::string& a6, + bool a7); + }; + + class Tokenizer { private: @@ -517,6 +556,11 @@ namespace WXML public: ExprSyntaxTree(/* args */); ~ExprSyntaxTree(); + void RenderAsOps( + std::stringstream & a2, + std::string const& a3, + bool & a4 + ); }; class Token diff --git a/src/night/night.cpp b/src/night/night.cpp new file mode 100644 index 0000000..71c6614 --- /dev/null +++ b/src/night/night.cpp @@ -0,0 +1,79 @@ +#include "../include/night.h" + +namespace night +{ + std::string NS_TYPE_BOOL; + std::string NS_TYPE_VAR; + std::string NS_TYPE_NUM; + std::string NS_TYPE_B_TYPE; + std::string NS_TYPE_OP_SELF; + std::string NS_TYPE_BINARY; + std::string NS_TYPE_ASSIGN; + std::string NS_TYPE_TERNARY; + std::string NS_TYPE_OBJ_DOT; + std::string NS_TYPE_OBJ_PROPERTY; + std::string NS_TYPE_OBJ_SELF_OP; + std::string NS_TYPE_OBJ_BLOCK; + std::string NS_TYPE_BRACKET; + std::string NS_TYPE_CALL; + std::string NS_TYPE_KW; + std::string NS_TYPE_SKIP; + std::string NS_TYPE_STR; + std::string NS_TYPE_PUNC; + std::string NS_TYPE_FUNC; + std::string NS_TYPE_PROG; + std::string NS_TYPE_PROG_NO_SEM; + std::string NS_TYPE_PROG_NO_SEM_REQUIRE; + std::string NS_TYPE_ARRAY; + std::string NS_TYPE_SWITCH; + std::string NS_TYPE_DO_WHILE; + std::string NS_TYPE_WHILE; + std::string NS_TYPE_FOR; + std::string NS_TYPE_IF; + std::string NS_TYPE_K_V; + + + std::string std_v_n = ""; + std::string std_v_v_n = ""; + + void compile_ns( + std::string const& a1, + std::string const& a2, + std::string const& a3, + uint a4, + std::string& a5, + bool a6) + { + a5 = ""; + night::NSStream v38(a1, a3, a4); + night::NSToken v27; + night::NSGod v17; + night::NSASTParse v39(a1, &v27, &v17); + + v17.hamlet(); + + } + + void compile_ns_with_sourcemap( + std::string const&, + std::string const&, + std::string const&, + std::string const&, + uint, + std::string&, + std::string& + ) + { + + } + + void readfile(char const*, std::string &) + { + + } + + void writefile(char const*, std::string &) + { + + } +} \ No newline at end of file diff --git a/src/night/ns_ast_parse.cpp b/src/night/ns_ast_parse.cpp new file mode 100644 index 0000000..25ad260 --- /dev/null +++ b/src/night/ns_ast_parse.cpp @@ -0,0 +1,41 @@ +#include "../include/night.h" + +namespace night +{ + + + NSASTParse::NSASTParse(/* args */) + { + } + + NSASTParse::NSASTParse(std::string a2, night::NSToken * a3, night::NSGod * a4) + { + this->offset_0 = a2; + this->offset_24 = a4; + this->offset_28 = a3; + this->offset_36 = 0; + this->offset_40 = 0; + this->offset_44 = ""; + this->offset_52 = 0; + } + + NSASTParse::~NSASTParse() + { + } + + void NSASTParse::is_op_or_comma(std::string const&) + { + + } + + void NSASTParse::is_punctuation(std::string const&) + { + + } + + void NSASTParse::top_down() + { + + } + +} \ No newline at end of file diff --git a/src/night/ns_compile_js.cpp b/src/night/ns_compile_js.cpp new file mode 100644 index 0000000..2b5eb16 --- /dev/null +++ b/src/night/ns_compile_js.cpp @@ -0,0 +1,285 @@ +#include "../include/night.h" + +namespace night +{ + + NSCompileJs::NSCompileJs(/* args */) + { + } + + NSCompileJs::~NSCompileJs() + { + } + + std::string NSCompileJs::compile_assign(night::ns_node * a3) + { + return this->compile_binary(a3); + } + std::string NSCompileJs::compile_binary(night::ns_node *a3) + { + this->compile(a3->offset_180); + std::string v10 = " " + a3->offset_156; + std::string v3 = v10.append(" "); + // this->offset_48 = + this->compile(a3->offset_184); + // v10 = v7 + v8; + std::string v4 = ""; + // v4 = v10.append(v9); + return v4; + } + std::string NSCompileJs::compile_call(night::ns_node *a3) + { + return ""; + } + std::string NSCompileJs::compile_do_while(night::ns_node *a3) + { + return ""; + } + std::string NSCompileJs::compile_for(night::ns_node *a3) + { + return ""; + } + std::string NSCompileJs::compile_function(night::ns_node *a3) + { + return ""; + } + std::string NSCompileJs::compile_if(night::ns_node *a3) + { + return ""; + } + std::string NSCompileJs::compile_k_v(night::ns_node *) + { + return ""; + } + std::string NSCompileJs::compile_obj_dot(night::ns_node *) + { + return ""; + } + std::string NSCompileJs::compile_obj_property(night::ns_node *) + { + return ""; + } + std::string NSCompileJs::compile_obj_self_op(night::ns_node *) + { + return ""; + } + std::string NSCompileJs::compile_op_self(night::ns_node *a3) + { + this->compile(a3->offset_192); + for (auto i = a3->offset_196.begin(); i != a3->offset_196.end(); i++) + { + this->compile(*i); + } + + return ""; + } + std::string NSCompileJs::compile_switch(night::ns_node *) + { + return ""; + } + std::string NSCompileJs::compile_ternary(night::ns_node *a3) + { + std::string v6 = this->compile(a3->offset_180); + v6.append(":"); + // += v7 + this->offset_48++; + this->compile(a3->offset_184); + // += v7 + return ""; + } + std::string NSCompileJs::compile_var(night::ns_node *) + { + return ""; + } + std::string NSCompileJs::compile_while(night::ns_node *) + { + return ""; + } + std::string NSCompileJs::compile_prog(night::ns_node *a3) + { + std::string v9 = a3->offset_108; + if (v9.size() == 0) + { + v9 = ";"; + } + auto v4 = a3->offset_228; + int v6 = 0; + for (auto i = v4.begin(); i != v4.end(); i++) + { + this->compile(*i); + v6++; + if (v6 != v4.size()) + { + // += + this->offset_48 += v9.size(); + } + } + return ""; + + } + + std::string NSCompileJs::compile_prog_no_sem(night::ns_node *a3) + { + if (night::NS_TYPE_OBJ_BLOCK == a3->offset_0) + { + // += + this->offset_48++; + } + for (auto i = a3->offset_228.begin(); i != a3->offset_228.end(); i++) + { + this->compile(*i); + // += + } + if (night::NS_TYPE_OBJ_BLOCK == a3->offset_0) + { + // += + this->offset_48++; + } + return ""; + } + + std::string NSCompileJs::compile(night::ns_node * a3) + { + if (this->offset_0.size() == 0) + { + std::string v9 = a3->offset_0; + if (night::NS_TYPE_SKIP == v9) + { + return ""; + } + if (v9 != night::NS_TYPE_NUM) + { + if (v9 == night::NS_TYPE_BOOL) + { + // TODO... + return ""; + } + if (v9 == night::NS_TYPE_STR) + { + // TODO... + return ""; + } + if (v9 != night::NS_TYPE_B_TYPE && v9 != night::NS_TYPE_PUNC) + { + if (v9 != night::NS_TYPE_KW) + { + std::string result = ""; + if (v9 == night::NS_TYPE_VAR) + { + result = this->compile_var(a3); + } + else if (v9 == night::NS_TYPE_K_V) + { + result = this->compile_k_v(a3); + } + else if (v9 == night::NS_TYPE_IF) + { + result = this->compile_if(a3); + } + else if (v9 == night::NS_TYPE_FOR) + { + result = this->compile_for(a3); + } + else if (v9 == night::NS_TYPE_WHILE) + { + result = this->compile_while(a3); + } + else if (v9 == night::NS_TYPE_DO_WHILE) + { + result = this->compile_do_while(a3); + } + else if (v9 == night::NS_TYPE_SWITCH) + { + result = this->compile_switch(a3); + } + else if (v9 == night::NS_TYPE_OBJ_SELF_OP) + { + result = this->compile_obj_self_op(a3); + } + else if (v9 == night::NS_TYPE_OBJ_PROPERTY) + { + result = this->compile_obj_property(a3); + } + else if (v9 == night::NS_TYPE_OBJ_DOT) + { + result = this->compile_obj_dot(a3); + } + else if (v9 == night::NS_TYPE_OP_SELF) + { + result = this->compile_op_self(a3); + } + else if (v9 == night::NS_TYPE_TERNARY) + { + result = this->compile_ternary(a3); + } + else if (v9 == night::NS_TYPE_BINARY || v9 == night::NS_TYPE_ASSIGN) + { + result = this->compile_binary(a3); + } + else if (v9 == night::NS_TYPE_FUNC) + { + result = this->compile_function(a3); + } + else if (v9 == night::NS_TYPE_CALL) + { + result = this->compile_call(a3); + } + else if (v9 == night::NS_TYPE_PROG) + { + result = this->compile_prog(a3); + } + else if (v9 == night::NS_TYPE_PROG_NO_SEM + || v9 == night::NS_TYPE_PROG_NO_SEM_REQUIRE + || v9 == night::NS_TYPE_OBJ_BLOCK + || v9 == night::NS_TYPE_ARRAY + || v9 == night::NS_TYPE_BRACKET) + { + result = this->compile_prog_no_sem(a3); + } + else + { + this->offset_0.assign(a3->offset_0); + } + return result; + } + std::string v10; + if ("this" == a3->offset_60) + { + v10 = "(this.constructor===Window?{}:this)"; + this->offset_48++; + } + else + { + v10.assign(a3->offset_60); + } + night::ns_sourcemap v13; + v13.offset_0 = a3->offset_24; + std::string v18 = a3->offset_60; + this->offset_36.push_back(v13); + bool v5 = "this" == a3->offset_60; + this->offset_48 = !v5 + v10.size() + this->offset_48 - 1; + return v10; + } + } + this->offset_48 += a3->offset_60.size(); + return a3->offset_60; + } + return ""; + } + + void NSCompileJs::compile_once(std::string &a3, std::vector *a4, bool a5) + { + this->offset_28 = a4; + a3 = ""; + this->offset_24->top_down(); + night::ns_node v5; + if (a5) + { + std::string ret = v5.debug_no_space(); + printf("ast :%s\n", ret.data()); + } + std::string v9 = this->compile(&v5); + a3 = v9; + } + +} \ No newline at end of file diff --git a/src/night/ns_god/ns_god.cpp b/src/night/ns_god/ns_god.cpp new file mode 100644 index 0000000..1610821 --- /dev/null +++ b/src/night/ns_god/ns_god.cpp @@ -0,0 +1,34 @@ +#include "../../include/night.h" +namespace night +{ + + NSGod::NSGod(/* args */) + { + } + + NSGod::~NSGod() + { + } + + void NSGod::gen_girl(std::string a2) + { + if (night::std_v_n == a2) + { + + } + if (night::std_v_v_n == a2) + { + + } + } + + void NSGod::gen_son(std::string) + { + + } + + void NSGod::hamlet(void) + { + + } +} // namespace night diff --git a/src/night/ns_node.cpp b/src/night/ns_node.cpp new file mode 100644 index 0000000..13e379b --- /dev/null +++ b/src/night/ns_node.cpp @@ -0,0 +1,19 @@ +#include "../include/night.h" + +namespace night +{ + + ns_node::ns_node(/* args */) + { + } + + ns_node::~ns_node() + { + } + + std::string ns_node::debug_no_space() + { + return ""; + } + +} \ No newline at end of file diff --git a/src/night/ns_sourcemap.cpp b/src/night/ns_sourcemap.cpp new file mode 100644 index 0000000..fbf29c4 --- /dev/null +++ b/src/night/ns_sourcemap.cpp @@ -0,0 +1,13 @@ +#include "../include/night.h" + +namespace night +{ + + ns_sourcemap::ns_sourcemap(/* args */) + { + } + + ns_sourcemap::~ns_sourcemap() + { + } +} \ No newline at end of file diff --git a/src/night/ns_stream.cpp b/src/night/ns_stream.cpp new file mode 100644 index 0000000..d6249c4 --- /dev/null +++ b/src/night/ns_stream.cpp @@ -0,0 +1,45 @@ +#include "../include/night.h" + +namespace night +{ + + NSStream::NSStream(/* args */) + { + } + NSStream::NSStream(std::string const&,std::string const&,uint) + { + } + + NSStream::~NSStream() + { + } + + void NSStream::peek(void) + { + if (this->offset_48 < this->offset_24.length()) + { + char v3 = this->offset_24.at(this->offset_48); + } + else + { + + } + } + void NSStream::peek_2(void) + { + if (this->offset_48 + 1 < this->offset_24.length()) + { + char v3 = this->offset_24.at(this->offset_48 + 1); + if (v3 == '\n') + { + this->offset_52++; + this->offset_56 = 1; + } + } + else + { + + } + } + +} \ No newline at end of file diff --git a/src/night/ns_token.cpp b/src/night/ns_token.cpp new file mode 100644 index 0000000..0ccf49d --- /dev/null +++ b/src/night/ns_token.cpp @@ -0,0 +1,20 @@ +#include "../include/night.h" + +namespace night +{ + NSToken::NSToken(/* args */) + { + } + + NSToken::~NSToken() + { + } + void NSToken::peek(void) + { + + } + void NSToken::read_next(void) + { + + } +} \ No newline at end of file diff --git a/src/night/sourcemap/sourcemap.cpp b/src/night/sourcemap/sourcemap.cpp new file mode 100644 index 0000000..130693e --- /dev/null +++ b/src/night/sourcemap/sourcemap.cpp @@ -0,0 +1,23 @@ +#include "../../include/night.h" +namespace night +{ + + namespace sourcemap + { + void gen_sourcemap_content( + std::string const&, + std::map, + std::map, + std::vector &, + int, + std::string&, + std::string*) + { + + } + void int2vlq(int) + { + + } + } // namespace sourcemap +} // namespace night diff --git a/src/night/str/str.cpp b/src/night/str/str.cpp new file mode 100644 index 0000000..33ff79f --- /dev/null +++ b/src/night/str/str.cpp @@ -0,0 +1,16 @@ +#include "../../include/night.h" +namespace night +{ + + namespace str + { + void get_token(std::string const&, int) + { + + } + void path_combine(std::string const&, std::string const&, std::string&) + { + + } + } // namespace str +} // namespace night diff --git a/src/wcc.cpp b/src/wcc.cpp index 53da11e..a880f7d 100644 --- a/src/wcc.cpp +++ b/src/wcc.cpp @@ -543,7 +543,7 @@ std::string EscapeToJsonString(std::string const& a2) if (cur == '\\' || cur == '"' || cur <= 0x1Fu) { ret << "\\u"; - ret << std::hex << std::setw(4) << std::setfill('0')<< cur; + ret << std::hex << std::setw(4) << std::setfill('0') << static_cast(cur); } else { diff --git a/src/wxml/compiler.cpp b/src/wxml/compiler.cpp index b9d93b2..2d14a39 100644 --- a/src/wxml/compiler.cpp +++ b/src/wxml/compiler.cpp @@ -5,6 +5,7 @@ #include #include #include +#include "../include/night.h" namespace WXML{ @@ -123,7 +124,7 @@ namespace WXML{ data = data.append(v74); auto v83 = WXML::Compiler::GetFuncId(a11, data); std::string v72; - // TODO: compile_ns + night::compile_ns(filePath, v83, v79, v65, v72, 0); int compilerResult = 1; if (compilerResult) { @@ -242,18 +243,18 @@ namespace WXML{ v307_localVecStrMap1["__COMMON__"] = commonVec; // mark - 10 - for (int i = 0; i < splitedData.size(); i++) + for (auto i = splitedData.begin(); i != splitedData.end(); i++) { std::shared_ptr v328_ss(new std::stringstream()); - auto it = ssDataMap.lower_bound(splitedData[i]); - if (it == ssDataMap.end()) + auto it = ssDataMap.lower_bound(*i); + if (it == ssDataMap.end() || *i < it->first) { - ssDataMap.insert({splitedData[i], v328_ss}); + ssDataMap.insert({*i, v328_ss}); } - std::string path = "./" + splitedData[i] + ".wxml"; + std::string path = "./" + *i + ".wxml"; std::vector j; j.push_back(path); - v307_localVecStrMap1[splitedData[i]] = j; + v307_localVecStrMap1[*i] = j; } // mark - 15 @@ -308,7 +309,18 @@ namespace WXML{ { std::set v328; WXML::DOMLib::recurseDependencies(i->second, i->first, v328); - // TODO: ... + // std::vector v278; + // for (auto j = v328.begin(); j != v328.end(); j++) + // { + // v278.push_back(*j); + // } + + auto depList = dependencyListMap[i->first]; + for (auto j = v328.begin(); j != v328.end(); j++) + { + depList.push_back(*j); + } + dependencyListMap[i->first] = depList; } // mark - 45 for (auto i = v304.begin(); i != v304.end(); i++) @@ -349,7 +361,7 @@ namespace WXML{ std::string const& fMark // "f_" a22 */ std::string jj; - if (!isLLA) + if (isLLA) { jj = "global"; } @@ -391,20 +403,52 @@ namespace WXML{ *ss << "codeURI,nv_decodeURIComponent,nv_encodeURI,nv_encodeURIComponent,$gdc,nv_JSON,_af,_gv,_ai,_grp,_gd,_gapi,$ix"; *ss << "c,_ic,_w,_ev,_tsd){"; *ss << "return function(path,global){" << lineEndMark; - *ss << "if(typeof global==='undefined'){if (typeof __GWX_GLOBAL__==='undefined')global={};else global=__GWX_GLOBAL__;}" << lineEndMark; + *ss << "if(typeof global==='undefined'){if (typeof __GWX_GLOBAL__==='undefined')global={};else global=__GWX_GLOBAL__;}"; *ss << "if(typeof __WXML_GLOBAL__ === 'undefined') {"; *ss << "__WXML_GLOBAL__={};" << lineEndMark; + + /* + + std::map const& fileContentMap, // a1 + std::string& errorMessage, // 错误信息 a2 + std::map& outputContentMap, // 输出 a3 + std::map& outputFuncMap, // 输出 a4 + std::map>& dependencyListMap, // a5 + std::map>& componentListMap, // componentListMap a6 + std::vector const& splitedData, // splitedData a7 + std::map const& mapData1, // mapData1 a8 + bool isLLA, // isLLA a9 + std::string const& gwxMark, // gwxMark a10 + uint mark, // mark a11 + char lineEndMark, // '\n' a12 + std::string const& eMark1, // 'e' a13 + std::string const& charArr, // const char off_5403C3[] = {'s','\0','e','\0'} a14 + std::string const& ggMark, // "gg" a15 + std::string const& eMark, // "e_" a16 + std::string const& dMark, // "d_" a17 + std::string const& pMark, // "p_" a18 + std::string const& strEndMark, // '\0' a19 + std::string const& boxMark, // "boxofchocolate" a20 + std::string const& gdwxMark, // "$gdwx" a21 + std::string const& fMark // "f_" a22 + */ if ((mark & 0x80) != 0) { // TODO + auto v252 = mapData1.find("life_cycle_callback_content"); + if (mapData1.end() != v252) + { + *ss << v252->second; + } } *ss << "}"; *ss << "__WXML_GLOBAL__.modules = __WXML_GLOBAL__.modules || {};" << lineEndMark; - if (v225 && gwxMark == "$gwx" && (mark & 0x60) == 0) + if (v225 && gwxMark != "$gwx" && (mark & 0x60) == 0) { *ss << "$gwx('init', global);" << lineEndMark; } - *ss << "var " << eMark << "=global.entrys;" << lineEndMark; + *ss << "var " << eMark << "={}" << lineEndMark; + *ss << "if(typeof(global.entrys)==='undefined')global.entrys={};" << eMark << "=global.entrys;" << lineEndMark; *ss << "var " << dMark << "={}" << lineEndMark; *ss << "if(typeof(global.defines)==='undefined')global.defines={};" << dMark << "=global.defines;" << lineEndMark; *ss << "var " << fMark << "={}" << lineEndMark; @@ -426,9 +470,9 @@ namespace WXML{ // i->first v248 auto v97 = v307_localVecStrMap1[i->first]; int cnt = 0; - for (auto i = v97.begin(); i != v97.end(); i++) + for (auto i0 = v97.begin(); i0 != v97.end(); i0++) { - std::shared_ptr v244 = v304[*i]; + std::shared_ptr v244 = v304[*i0]; cnt++; std::string v98 = std::to_string(cnt); std::string v321 = v318 + "_" + v98; @@ -448,7 +492,10 @@ namespace WXML{ *ss << "function Z(ops){z.push(ops)}"; } *ss << lineEndMark; - // TODO: RenderAllOpsAndRecord + std::map v319; + WXML::DOMLib::RVMOpCodePositionRecorder v300; + // TODO: 待处理,死循环 + // v244->RenderAllOpsAndRecord(*i0, errorMessage, *ss, v319, &v300, (mark & 4) != 0, mapData1); *ss << "})(__WXML_GLOBAL__.ops_cached." << v321 << ");"; *ss << "return __WXML_GLOBAL__.ops_cached." << v321 << lineEndMark; *ss << "}" << lineEndMark; @@ -483,9 +530,9 @@ namespace WXML{ *ss << "e.stack += '\\n at ' + n.substring(2);console.error(e);}"; *ss << lineEndMark; *ss << "}}}()" << lineEndMark; - for (auto i = v309.begin(); i != v309.end(); i++) + for (auto j = v309.begin(); j != v309.end(); j++) { - *ss << i->second << lineEndMark; + *ss << j->second << lineEndMark; } } @@ -606,7 +653,8 @@ namespace WXML{ } } } - *ss << "}}" << lineEndMark; + *ss << "]}" << lineEndMark; + v228++; } *ss << "if(path&&" << eMark << "[path]){" << lineEndMark; @@ -690,7 +738,7 @@ namespace WXML{ auto v197 = v307_localVecStrMap1[i->first]; *ss << "if(__vd_version_info__.delayedGwx||"; std::string v198 = "true"; - if (!( v225 || v197.size() > 0)) + if (!( v225 || v197.size() != 1)) { v198 = "false"; } @@ -846,7 +894,7 @@ namespace WXML{ result << "';"; result << a2; result << ".__wcc_version_info__={\"customComponents\":true,\"fixZeroRpx\":true,\"propValueDeepCopy\":false};"; - result.str(a1); + a1 = result.str(); } int RenderDefine( @@ -908,30 +956,30 @@ namespace WXML{ a20); } - for (int i = 0; i < 6; i++) + for (int i = 0; i < a1.offset_72.size(); i++) { - /* code */ - // WXML::Compiler::RenderDefine( - // v23 + 8 * i, - // a2, - // a3, - // a4, - // a5, - // a6, - // a7, - // a8, - // a9, - // a10, - // a11, - // a12, - // a13, - // a14, - // a15, - // a16, - // a17, - // a18, - // a19, - // a20); + auto cur = a1.offset_72[i]; + WXML::Compiler::RenderDefine( + *cur, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9, + a10, + a11, + a12, + a13, + a14, + a15, + a16, + a17, + a18, + a19, + a20); } diff --git a/src/wxml/dom_lib/common.cpp b/src/wxml/dom_lib/common.cpp index 13bb055..d0a0c2b 100644 --- a/src/wxml/dom_lib/common.cpp +++ b/src/wxml/dom_lib/common.cpp @@ -95,6 +95,18 @@ namespace WXML { return a1.second.offset_40 < a2.second.offset_40; } + + std::string removern(std::string const& a2) + { + std::string a1; + for (int i = 0; i < a2.length() - 1; i++) + { + char v3 = a2[i]; + if (v3 != 13 || a2[i + 1] != '\n') + a1.push_back(v3); + } + return a1; + } } } \ No newline at end of file diff --git a/src/wxml/dom_lib/rvm_op_code_position.cpp b/src/wxml/dom_lib/rvm_op_code_position.cpp index 3aaf000..4186e65 100644 --- a/src/wxml/dom_lib/rvm_op_code_position.cpp +++ b/src/wxml/dom_lib/rvm_op_code_position.cpp @@ -7,6 +7,10 @@ namespace WXML * 感觉不太对,可能不是一个类 */ + RVMOpCodePosition::RVMOpCodePosition(std::string a) + { + this->offset_0 = a; + } RVMOpCodePosition::RVMOpCodePosition(/* args */) { } diff --git a/src/wxml/dom_lib/str_cache.cpp b/src/wxml/dom_lib/str_cache.cpp index 8ad2589..6475389 100644 --- a/src/wxml/dom_lib/str_cache.cpp +++ b/src/wxml/dom_lib/str_cache.cpp @@ -17,24 +17,32 @@ namespace WXML { void StrCache::RenderPathDefine(std::stringstream &ss) { ss << "var x=["; - // TODO... - // return ss; + for (int i = 0; i < this->offset_24.size(); i++) + { + if (i) + ss << ","; + ss << "'"; + WXML::Rewrite::ToStringCode(this->offset_24[i], ss); + ss << "'"; + } + ss << "];"; + } void StrCache::Insert(std::string s) { - if (!this->d.count(s)) + if (!this->offset_0.count(s)) { - // this->d[s] = this[5]; // ??? - this->offset_6.push_back(s); + this->offset_0[s] = this->offset_20; + this->offset_24.push_back(s); } } int StrCache::GetStrID(std::string s) { int result = -1; - if(this->d.count(s)) + if(this->offset_0.count(s)) { - return this->d[s]; + return this->offset_0[s]; } return result; } diff --git a/src/wxml/dom_lib/wxml_dom.cpp b/src/wxml/dom_lib/wxml_dom.cpp index c91e3f3..7dc8629 100644 --- a/src/wxml/dom_lib/wxml_dom.cpp +++ b/src/wxml/dom_lib/wxml_dom.cpp @@ -7,7 +7,7 @@ namespace WXML { namespace DOMLib { - + static const char *szWXIFControlAttrs[4] = { "wx-if", "wx:if", "wx:elif", "wx:else" }; WXMLDom::WXMLDom(/* args */) { } @@ -15,7 +15,243 @@ namespace WXML { WXMLDom::~WXMLDom() { } - const char off_553FDC[] = {'[','x','[','\0'}; + + int WXMLDom::DealSingleTokenToOps( + std::string const& a1, + std::string& a2, + std::stringstream & a3, + std::map & a4, + WXML::DOMLib::Token * a5, + bool a6, + int a7, + bool a8, + WXML::DOMLib::RVMOpCodePositionRecorder * a9, + bool a10, + const std::map & a11 + ) + { + // DealSingleTokenToOps - 0 + std::string v11; + if (a8) + { + v11 = a5->ToString(); + } + else + { + v11 = a5->ToAttrContent(); + } + std::vector v77; + bool v77_b; + int d = WXML::StringTemplating::Deal(&v11[0], a2, v77, v77_b); + if (d) + { + throw this->Error(a1, *a5, "", "did you forget }}, ' or \""); + } + // DealSingleTokenToOps - 10 + if ( a8) + { + auto ptm = a11.find("plain_text_marker"); + if (ptm != a11.end()) + { + + WXML::StringTemplating::Token v85; + v85.offset_0 = false; + v85.offset_4 = ptm->second; + v77.push_back(v85); + } + } + // DealSingleTokenToOps - 15 + if (a7) + { + int v26; + if (v26 != a7) + { + a5->offset_56 = -3; + a5->offset_60 = "the very attr must be an expression (surrouned by `{{..}}`)"; + return -1; + } + + } + // DealSingleTokenToOps - 20 + if (v77.begin() == v77.end()) + { + WXML::StringTemplating::Token token; + token.offset_0 = false; + token.offset_4 = ""; + v77.push_back(token); + } + // DealSingleTokenToOps - 25 + int v52 = 1; + if (v77.size() < 0x1C) + { + v52 = 0; + // TODO.. + } + a3 << "Z("; + if (v52) + { + a3 << "[a,"; + a9->offset_4++; + } + std::vector> v80; + // DealSingleTokenToOps - 30 + std::string v27 = "nt_"; + if (a8) + v27 = "t_"; + std::string v28 = ""; + if (a6) + { + v28 = "_d"; + } + for (int i = 0; i < v77.size(); i++) + { + if (i) + a3 << ","; + auto v62 = v77[i]; + std::string v29 = "s_"; + if (v62.offset_0) + v29 = "e_"; + v29.append(v27); + v29.append(v62.offset_4); + v29.append(v28); + auto v63 = a4.find(v29); + if (v63 == a4.end()) + { + + if (v77[i].offset_0) + { + WXML::EXPRLib::Parser vp; + std::string v85 = ""; + int ret = vp.Parse(v77[i].offset_4, v85, 1, 1, a2, a6); + if (ret) + { + a5->offset_56 = -3; + a5->offset_60.assign(a2); + a3 << "undefined"; + break; + } + WXML::EXPRLib::ExprSyntaxTree v70; + v70.RenderAsOps(a3, v85, v77_b); + } + else + { + a3 << "[3,'"; + std::string r = WXML::DOMLib::removern(v77[i].offset_4); + WXML::Rewrite::ToStringCode(r, a3); + a3 << "']"; + } + int v43 = -1; + if (v52) + { + v43 = a9->offset_4; + } + WXML::DOMLib::RVMOpCodePosition pos; + v80.push_back({"", pos}); + } + else + { + if (v63->second.offset_4 == -1 ) + { + if (a10) + { + + a3 << "z["; + a3 << v63->second.offset_0; + a3 << "][1]"; + a9->offset_4++; + continue; + } + + a3 << "z["; + a3 << v63->second.offset_0; + } + else + { + + a3 << "z["; + a3 << v63->second.offset_0; + if (a10) + { + a3 << "][1]["; + } + else + { + a3 << "]["; + } + a3 << v63->second.offset_4; + } + a3 << "]"; + } + a9->offset_4++; + } + // DealSingleTokenToOps - 35 + if (v52) + a3 << "]"; + if (a5->offset_56 == -1) + a5->offset_56 = a9->offset_0; + a9->offset_0++; + for (auto i = v80.begin(); i != v80.end(); i++) + { + a4.emplace(i->first, i->second); + } + + if (a10) + { + a3 << ",['" << WXML::Rewrite::ToStringCode(a1); + a3 << "'," << a5->offset_8; + a3 << "," << a5->offset_12; + a3 << "])\n"; + } + else + { + a3 << ")\n"; + } + return 0; + } + void WXMLDom::RenderAllOpsAndRecord( + std::string const& a2, + std::string& a3, + std::stringstream & a4, + std::map &a5, + WXML::DOMLib::RVMOpCodePositionRecorder *a6, + bool a7, + const std::map & a8 + ) + { + if (this->offset_0 == "TEXTNODE") + { + this->DealSingleTokenToOps(a2, a3, a4, a5, &this->offset_84, 0, 0, 1, a6, a7, a8); + } + else + { + for (auto i = this->offset_48.begin(); i != this->offset_48.end(); i++) + { + if ( + i->second.offset_20 + && this->offset_0 != "import" + && this->offset_0 != "include" + ) + { + if ( + this->offset_0 == "wx-template" && i->first == "data" + || this->offset_0 == "wx-scope" && i->first == "wx:scope-data" + ) + { + this->DealSingleTokenToOps(a2, a3, a4, a5, &i->second, 1, 1, 0, a6, a7, a8); + } + else + { + this->DealSingleTokenToOps(a2, a3, a4, a5, &i->second, 0, 0, 0, a6, a7, a8); + } + } + } + for (int i = 0; i < this->offset_72.size(); i++) + { + this->RenderAllOpsAndRecord(a2, a3, a4, a5, a6, a7, a8); + } + + } + } void WXMLDom::RenderMeAsFunction( std::string const& a2, std::string const& a3, @@ -42,7 +278,7 @@ namespace WXML { a7->GetNextName(name); if (a15) { - a6 << a12 << off_553FDC; + a6 << a12 << "[x["; int id = offset_248.GetStrID(a2); a6 << id; a6 << "]][\""; @@ -59,7 +295,7 @@ namespace WXML { a6 << a11 << ","; a6 << a10 << "){"; a6 << a13; - // if (a18) + if (a18.size()) { a6 << "var z=" << a18 << "()" << a13; } @@ -76,7 +312,7 @@ namespace WXML { a6 << WXML::Rewrite::ToStringCode(a2); a6 << "\"],\"\",1)"; a6 << a13; - a6 << "if(" << a14 << "[" << name << "]{_wl("; + a6 << "if(" << a14 << "[" << name << "]){_wl("; a6 << name << ",x["; id = this->offset_248.GetStrID(a2); a6 << id << "]);return}" << a13; @@ -84,7 +320,8 @@ namespace WXML { a6 << a14 << "[" << name << "]=true"; a6 << a13 << "try{" << a13; } - // RenderChildren + std::map v79; + // this->RenderChildren(a2, a3, a4, a11, a6, a7, a8, a9, a10, a12, a13, a16, a17, &v79); if (a15) { a6 << "}catch(err){" << a13; @@ -118,20 +355,278 @@ namespace WXML { std::map * a15 ) { + // RenderChildren - 0 auto size = a6.tellp(); if (size > 52428800) { - throw "Interal error: generated code (>10M) will be too heavy to fly in a narrow wind."; + throw "RenderException Interal error: generated code (>10M) will be too heavy to fly in a narrow wind."; } - // while (/* condition */) - // { - // /* code */ - // } - int Stra; - // for (int i = 0; ; i = Stra) - // { - - // } + int v109 = 0; + int v110 = 0; + std::string v145; + std::string v147; + for (int i = 0; i < this->offset_72.size(); i++) + { + std::shared_ptr cur = this->offset_72[i]; + auto srcToken = cur->offset_48.find("src"); + if ( + (cur->offset_0 == "import" + || cur->offset_0 == "wx-import") + && ( srcToken != cur->offset_48.end()) + ) + { + if (!v110) + { + a7->GetNextName(v145); + a6 << "var " << v145 << "=" << a3 << "[x["; + int StrID = this->offset_248.GetStrID(a2); + a6 << StrID << "]].i" << a12; + } + v110++; + } + else if (cur->offset_0 == "include") + { + if (srcToken != cur->offset_48.end()) + { + if (!v109) + { + a7->GetNextName(v147); + a6 << "var " << v147 << "=" << a3; + a6 << "[x[" << this->offset_248.GetStrID(a2) << "]].j" << a12; + } + } + } + } + // RenderChildren - 5 + std::string v149; + int Stra = 0; + for (int v127 = 0; v127 < this->offset_72.size(); v127++) + { + auto cur = this->offset_72[v127]; + int Str = 1; + if (cur->offset_48.find("wx-if") == cur->offset_48.end()) + { + Str = cur->offset_48.end() != cur->offset_48.find("wx:if"); + } + if (Str) + { + a7->GetNextName(v149); + cur->offset_220.assign(v149); + Stra = 2; + cur->offset_244 = 1; + } + else + { + if (cur->offset_48.find("wx:elif") == cur->offset_48.end()) + { + if (cur->offset_48.find("wx:else") != cur->offset_48.end()) + { + if (Stra == 0) + { + throw this->Error(a2, cur->offset_84, "wx:else", "`wx:if not found, then something must be wrong`"); + } + cur->offset_244 = v127; + cur->offset_220.assign(v149); + } + Stra = 0; + } + else + { + if (Stra == 0) + { + throw this->Error(a2, cur->offset_84, "wx:elif", "`wx:if not found, then something must be wrong`"); + } + Stra++; + cur->offset_244 = v127; + cur->offset_220.assign(v149); + } + } + + } + // RenderChildren - 10 + std::string v151; + v151.assign(a5); + std::vector> v142; + for (int j = 0; j < this->offset_72.size(); j++) + { + std::shared_ptr cur = this->offset_72[j]; + std::string v153; + const char **v98 = szWXIFControlAttrs; + if (cur->offset_244 <= 0) + { + goto LABEL_56; + } + while (true) + { + if (!*v98) + break; + auto v97 = cur->offset_48.find(*v98); + if (v97 != cur->offset_48.end()) + { + v153 = *v98; + break; + } + ++v98; + } + if(cur->offset_48[v153].offset_56 == -3) + { + throw this->Error(a2, cur->offset_48[v153], v153, cur->offset_48[v153].offset_60); + } + if(cur->offset_48[v153].offset_56 == -1 && v153 != "wx:else") + { + throw this->Error(a2, cur->offset_84, v153, "value not set"); + } + if (v153 == "wx-if" || v153 == "wx:if") + { + a6 << "var " << cur->offset_220 << "=_v()" << a12; + a6 << "_(" << a5 << "," << "," << cur->offset_220 << ")" << a12; + a6 << "if(_oz(z," << cur->offset_48[v153].offset_56 << "," << a8 << ","; + a6 << a9 << "," << a10 << ")){" << cur->offset_220 << ".wxVkey="; + a6 << cur->offset_244 << a12; + v142.emplace_back(cur->offset_220, 1); + if (cur->offset_256) + goto LABEL_54; + } + else + { + if (v153 != "wx:elif") + { + a6 << "else{" << cur->offset_220 << ".wxVkey=" << cur->offset_244 << a12; + if (!cur->offset_256) + goto LABEL_55; + LABEL_54: + v142.emplace_back(cur->offset_220, 3); + goto LABEL_55; + } + a6 << "else if(_oz(z," << cur->offset_48[v153].offset_56 << "," << a8 << "," << a9 << "," << a10 << ")){"; + a6 << cur->offset_220 << ".wxVkey=" << cur->offset_244 << a12; + + if (cur->offset_256) + goto LABEL_54; + } + LABEL_55: + v151.assign(cur->offset_220); + LABEL_56: + if ( + cur->offset_0 == "import" + || cur->offset_0 == "wx-import" + ) + { + auto srcToken = cur->offset_48.find("src"); + if (srcToken != cur->offset_48.end()) + { + a6 << "_ai(" << v145 << ",x["; + std::string v66 = srcToken->second.ToAttrContent(); + int v67 = this->offset_248.GetStrID(v66); + a6 << v67 << "]," << a3 << ",x[" << this->offset_248.GetStrID(a2) << "],"; + a6 << cur->offset_92 << "," << cur->offset_96 << ")" << a12; + goto LABEL_74; + } + } + if ( + cur->offset_0 != "import" + && cur->offset_0 != "wx-import" + ) + { + if ( + cur->offset_0 != "wx-repeat" + && cur->offset_0 != "wx-template" + ) + { + std::string v155; + a7->GetNextName(v155); + a6 << "var " << v155 << "=_v()" << a12; + a6 << "_(" << v151 << "," << v155 << ")" << a12; + cur->RenderNonDefine( + a2, + a3, + a4, + v155, + a6, + a7, + a8, + a9, + a10, + a11, + a12, + a13, + a14, + a15); + goto LABEL_74; + } + if ( + cur->offset_0 == "block" + || cur->offset_0 == "include" + ) + { + cur->RenderNonDefine( + a2, + a3, + a4, + v151, + a6, + a7, + a8, + a9, + a10, + a11, + a12, + a13, + a14, + a15); + goto LABEL_74; + } + if (cur->offset_0 == "wx-import") + { + if (cur->offset_0 == "wx-define") + { + std::string v155; + a7->GetNextName(v155); + cur->RenderNonDefine( + a2, + a3, + a4, + v155, + a6, + a7, + a8, + a9, + a10, + a11, + a12, + a13, + a14, + a15); + a6 << "_(" << v151 << "," << v155 << ")" << a12; + goto LABEL_74; + } + } + } + LABEL_74: + if (cur->offset_244 > 0) + { + a6 << "}" << a12; + } + } + // RenderChildren - 15 + for (int i = 0; i < v142.size(); i++) + { + a6 << v142[i].first << ".wxXCkey=" << v142[i].second << a12; + } + + // RenderChildren - 20 + for (int i = 0; i < v110; i++) + { + a6 << v145 << ".pop()" << a12; + } + + // RenderChildren - 25 + for (int i = 0; i < v109; i++) + { + a6 << v147 << ".pop()" << a12; + } + + // RenderChildren - 30 } @@ -410,7 +905,7 @@ namespace WXML { if (this->offset_0 == "block") { - WXML::DOMLib::WXMLDom::RenderChildren(a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); + this->RenderChildren(a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); goto LABEL_169; } diff --git a/src/wxml/expr_lib/expr_syntax_tree.cpp b/src/wxml/expr_lib/expr_syntax_tree.cpp new file mode 100644 index 0000000..3459b12 --- /dev/null +++ b/src/wxml/expr_lib/expr_syntax_tree.cpp @@ -0,0 +1,26 @@ +#include "../../include/wxml.h" + +namespace WXML +{ + + namespace EXPRLib + { + + ExprSyntaxTree::ExprSyntaxTree(/* args */) + { + + } + ExprSyntaxTree::~ExprSyntaxTree() + { + + } + void ExprSyntaxTree::RenderAsOps( + std::stringstream & a2, + std::string const& a3, + bool & a4 + ) + { + + } + } +} \ No newline at end of file diff --git a/src/wxml/expr_lib/parser.cpp b/src/wxml/expr_lib/parser.cpp new file mode 100644 index 0000000..5f0e3de --- /dev/null +++ b/src/wxml/expr_lib/parser.cpp @@ -0,0 +1,26 @@ +#include "../../include/wxml.h" + +namespace WXML +{ + + namespace EXPRLib + { + Parser::Parser(/* args */) + { + } + + Parser::~Parser() + { + } + int Parser::Parse( + std::string const& a2, + std::string const& a3, + int a4, + int a5, + std::string& a6, + bool a7) + { + return 0; + } + } +} // namespace WXML diff --git a/src/wxml/string_templating/common.cpp b/src/wxml/string_templating/common.cpp index cc17c7b..7d15884 100644 --- a/src/wxml/string_templating/common.cpp +++ b/src/wxml/string_templating/common.cpp @@ -4,14 +4,141 @@ namespace WXML namespace StringTemplating { - void Deal( - char const*Str, + int Deal( + char const* Str, std::string &a2, std::vector &a3, bool & a4 ) { + int v4 = strlen(Str); + int v5 = 0; + int v12 = 0; + int v17 = 0; + int i; + for ( i = 0; i < v4 - 1; i++) + { + char v6 = Str[i]; + char v7 = Str[i + 1]; + if (v17 == 2) + { + if (v6 == '\\') + { + ++i; + continue; + } + v12 = 1; + if (v6 != '"') + { + v12 = v17; + } + v17 = v12; + continue; + } + if (v17 > 2) + { + if (v6 == '\\') + { + i++; + continue; + } + v12 = 1; + if (v6 != '\'') + { + v12 = v17; + } + v17 = v12; + continue; + } + if (v17) + { + if (v6 != '}' || v7 != '}') + { + if (v6 == '"') + { + v17 = 2; + continue; + } + v12 = 4; + if (v6 != '\'') + { + v12 = v17; + } + v17 = v12; + continue; + } + if (i > v5) + { + int v8 = i - 1; + while (true) + { + char v9 = Str[v5]; + if (v9 != ' ' && v9 != '\t') + break; + ++v5; + } + while(v5 < v8) + { + char v10 = v8[Str]; + if (v10 != ' ' && v10 != '\t') + { + goto LABEL_30; + } + --v8; + } + if (v5 != v8) + { + goto LABEL_31; + } + LABEL_30: + WXML::StringTemplating::Token v20; + v20.offset_0 = true; + std::string v19; + // TODO: 待确认 + v19.append(Str, v5, v8 -v5 + 1); + v20.offset_4 = v19; + a3.push_back(v20); + a4 = true; + + } + LABEL_31: + v17 = 0; + v5 = i + 2; + ++i; + } + else if (v6 == '{' && v7 == '{') + { + if (i > v5) + { + WXML::StringTemplating::Token v20; + std::string v19; + v19.append(Str, v5, i -v5); + v20.offset_0 = false; + v20.offset_4 = v19; + a3.push_back(v20); + } + v17 = 1; + v5 = i + 2; + i++; + } + } + if (v17) return 1; + int v13 = ~(i - v4); + if (i < v4 - 1) + v13 = 0; + int v14 = i + v13; + if (v5 <= v14) + { + WXML::StringTemplating::Token v20; + std::string v19; + v19.append(Str, v5, v14 - v5 + 1); + v20.offset_0 = false; + v20.offset_4 = v19; + a3.push_back(v20); + } + + return v17; } } // namespace StringTamplating diff --git a/test/wcc.disassembly.cpp b/test/wcc.disassembly.cpp index ce4611a..4f0835b 100644 --- a/test/wcc.disassembly.cpp +++ b/test/wcc.disassembly.cpp @@ -11158,6 +11158,7 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::RenderDefine( } for ( i = 0; ; ++i ) { + // 18 * 4 = 72 v23 = (*a1)[18]; if ( (int)((*a1)[19] - v23) >> 3 <= i || lpuexcpt ) break; @@ -14363,6 +14364,7 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy( std::string::basic_string((char *)&jj, (int)i1); WXML::DOMLib::StrCache::Insert(v255, (int)&jj); std::string::_M_dispose((void **)&jj); + // v304[i1] v134 = (volatile signed __int32 **)(*(_DWORD *)std::map>::operator[]( &v304, (int)i1) @@ -15490,11 +15492,18 @@ _DWORD *__thiscall night::NSStream::peek(_DWORD *ecx0, night::NSStream *this) int v4; // edx char v5; // cl + // (_DWORD *)this + 12 -> this->offset_48 + // (_DWORD *)this + 7 -> this->offset_28 if ( *((_DWORD *)this + 12) < *((_DWORD *)this + 7) ) { + // this->offset_24 std::string, offset_28 std::string.length() + // (_DWORD *)this + 6 -> this->offset_24 + // (_DWORD *)this + 12 -> this->offset_48 v3 = (char *)std::string::at((_DWORD *)this + 6, *((_DWORD *)this + 12)); + // (_DWORD *)this + 14 -> this->offset_56 v4 = *((_DWORD *)this + 14); v5 = *v3; + // (_DWORD *)this + 13 -> this->offset_52 ecx0[1] = *((_DWORD *)this + 13); *(_BYTE *)ecx0 = v5; ecx0[2] = v4; @@ -15514,16 +15523,17 @@ _DWORD *__thiscall night::NSStream::peek_2(_DWORD *ecx0, night::NSStream *this) char v3; // dl int v4; // ecx int v5; // eax - + // this->offset_48 + 1 < this->offset_24.length() if ( (unsigned int)(*((_DWORD *)this + 12) + 1) < *((_DWORD *)this + 7) ) { + // this->offset_24.at(this->offset_48 + 1) v3 = *(_BYTE *)std::string::at((_DWORD *)this + 6, *((_DWORD *)this + 12) + 1); - v4 = *((_DWORD *)this + 13); - v5 = *((_DWORD *)this + 14) + 1; - if ( v3 == 10 ) + v4 = *((_DWORD *)this + 13); // this->offset_52 + v5 = *((_DWORD *)this + 14) + 1;// this->offset_56 + 1 + if ( v3 == '\n'/*10*/ ) { - ++v4; - v5 = 1; + ++v4; // 行数 + v5 = 1;// 当前行字符位置 } *(_BYTE *)ecx0 = v3; ecx0[1] = v4; @@ -15679,14 +15689,14 @@ unsigned __int8 __thiscall night::NSToken::skip_comment(night::NSStream **this, if ( result ) break; result = (unsigned __int8)night::NSStream::peek(v5, this[1]); - if ( LOBYTE(v5[0]) != 47 ) + if ( LOBYTE(v5[0]) != '/'/*47*/ ) break; result = night::NSStream::eof_2(this[1]); if ( result ) break; night::NSStream::peek_2(v5, this[1]); v4 = this[1]; - if ( LOBYTE(v5[0]) == 47 ) + if ( LOBYTE(v5[0]) == '/'/*47*/ ) { night::NSStream::next(v5, v4); night::NSStream::next(v5, this[1]); @@ -15695,7 +15705,7 @@ unsigned __int8 __thiscall night::NSToken::skip_comment(night::NSStream **this, else { result = (unsigned __int8)night::NSStream::peek_2(v5, v4); - if ( LOBYTE(v5[0]) != 42 ) + if ( LOBYTE(v5[0]) != '*'/*42*/ ) return result; night::NSStream::next(v5, this[1]); night::NSStream::next(v5, this[1]); @@ -15746,7 +15756,7 @@ bool __stdcall night::NSASTParse::is_save_for_division(int a1) v3 = a1 + 60; if ( !std::operator==("null", a1 + 60) && !std::operator==("undefined", v3) - && !std::operator==((char *)off_552620, v3) ) + && !std::operator==((char *)off_552620, v3) ) // "NaN" { v2 = std::operator==("Infinity", v3); goto LABEL_22; @@ -16041,11 +16051,12 @@ int __thiscall night::NSGod::gen_girl(void *this, int a2) int v7; // edx _DWORD *v9; // [esp+1Ch] [ebp-Ch] BYREF - v3 = operator new(0x1Cu); - *v3 = v3 + 2; - v3[1] = 0; - *((_BYTE *)v3 + 8) = 0; + v3 = operator new(0x1Cu); // 0x1C -> 28 + *v3 = v3 + 2; // v3.offset_8 缓冲区 + v3[1] = 0; // v3.offset_4 长度 + *((_BYTE *)v3 + 8) = 0; // 缓冲区第一个字节是0 v9 = v3; + // v3是一个std::string std::string::_M_assign((int)v3, a2); if ( std::operator==((int)&night::std_v_n, a2) ) { @@ -19516,8 +19527,8 @@ void **__thiscall night::NSCompileJs::compile[abi:cxx11](void **this, int a2, _D std::string::basic_string((char *)v9, (int)a3); if ( std::operator==((int)&night::NS_TYPE_SKIP, (int)v9) ) { - std::string::basic_string(this, (char *)&byte_551F04); -LABEL_60: + std::string::basic_string(this, (char *)&byte_551F04); // '\0' + LABEL_60: // 销毁数据,返回this std::string::_M_dispose(v9); return this; } @@ -19547,7 +19558,7 @@ LABEL_60: std::string::basic_string(this, &v10); std::string::_M_dispose((void **)&v10); night::ns_sourcemap::~ns_sourcemap((void **)&v13); - goto LABEL_60; + goto LABEL_60; // 销毁数据,返回this } if ( std::operator==((int)&night::NS_TYPE_STR, (int)v9) ) { @@ -19557,11 +19568,11 @@ LABEL_60: std::string::_M_dispose((void **)&v13); *(_DWORD *)(a2 + 48) += v11; std::string::basic_string(this, &v10); -LABEL_10: + LABEL_10: v4 = &v10; -LABEL_11: + LABEL_11: std::string::_M_dispose((void **)v4); - goto LABEL_60; + goto LABEL_60; // 销毁数据,返回this } if ( !std::operator==((int)&night::NS_TYPE_B_TYPE, (int)v9) && !std::operator==((int)&night::NS_TYPE_PUNC, (int)v9) ) @@ -19646,7 +19657,7 @@ LABEL_11: std::string::_M_assign(a2, (int)a3); std::string::basic_string(this, (char *)&byte_551F04); } - goto LABEL_60; + goto LABEL_60; // 销毁数据,返回 } v10 = &v12; v11 = 0; @@ -19671,27 +19682,29 @@ LABEL_11: v20[0] = 0; v21 = 0; v22 = 0; + // a3 + 6 -> a3.offset_24 std::string::_M_assign((int)&v13, (int)(a3 + 6)); v16 = a3[12]; v17 = a3[13]; - std::string::_M_assign((int)&v18, v7); + std::string::_M_assign((int)&v18, v7); // a3.offset_60 v21 = a3[12]; - v22 = *(_DWORD *)(a2 + 48); + v22 = *(_DWORD *)(a2 + 48); // a2.offset_48 std::vector::push_back((night::ns_sourcemap **)(a2 + 36), (night::ns_sourcemap *)&v13); v5 = std::operator==("this", v7); *(_DWORD *)(a2 + 48) = !v5 + v11 + *(_DWORD *)(a2 + 48) - 1; std::string::basic_string(this, &v10); night::ns_sourcemap::~ns_sourcemap((void **)&v13); - goto LABEL_10; + goto LABEL_10; // 销毁数据,返回this } } + // a3 + 15 -> a3.offset_60 std::string::basic_string((char *)&v13, (int)(a3 + 15)); *(_DWORD *)(a2 + 48) += v14; std::string::basic_string(this, &v13); v4 = &v13; - goto LABEL_11; + goto LABEL_11; // 销毁数据,返回 } - std::string::basic_string(this, (char *)&byte_551F04); + std::string::basic_string(this, (char *)&byte_551F04); // "\0" return this; } @@ -20246,6 +20259,7 @@ _DWORD *__thiscall night::NSCompileJs::compile_binary[abi:cxx11](_DWORD *this, i void *v9[6]; // [esp+80h] [ebp-38h] BYREF int v10[8]; // [esp+98h] [ebp-20h] BYREF + // a3.offset_180 night::NSCompileJs::compile[abi:cxx11](a2, *(_DWORD *)(a3 + 180)); std::operator+((int)v10, " ", a3 + 156); v3 = std::string::append(v10, " "); @@ -20450,11 +20464,12 @@ _DWORD *__thiscall night::NSCompileJs::compile_prog_no_sem[abi:cxx11](_DWORD *th *((_BYTE *)this + 8) = 0; if ( std::operator==((int)&night::NS_TYPE_OBJ_BLOCK, a3) ) { - std::string::operator+=(asc_5527F4); + std::string::operator+=(asc_5527F4); // "(\000)\000{" ++*(_DWORD *)(a2 + 48); } for ( lpuexcpt = 0; ; ++lpuexcpt ) { + // a3.offset_228 v3 = *(_DWORD **)(a3 + 228); if ( lpuexcpt >= (v3[1] - *v3) >> 2 ) break; @@ -20481,8 +20496,9 @@ char *__thiscall night::NSCompileJs::compile_once(char *this, int a2, unsigned i struct _Unwind_Exception *lpuexcpt; // [esp+18h] [ebp-60h] void *v9[8]; // [esp+58h] [ebp-20h] BYREF + // a2.offset_28 *(_DWORD *)(a2 + 28) = a4; - std::string::operator=(a3, (char *)&byte_551F04); + std::string::operator=(a3, (char *)&byte_551F04); // "\0" v5 = (const char **)night::NSASTParse::top_down(*(int **)(a2 + 24)); lpuexcpt = (struct _Unwind_Exception *)v5; if ( a5 ) @@ -20491,6 +20507,7 @@ char *__thiscall night::NSCompileJs::compile_once(char *this, int a2, unsigned i printf("ast :%s\n", (const char *)v9[0]); std::string::_M_dispose(v9); } + // night::ns_node *lpuexcpt night::NSCompileJs::compile[abi:cxx11](v9, a2, lpuexcpt); std::string::_M_assign((int)a3, (int)v9); std::string::basic_string(this, a2); @@ -20535,7 +20552,7 @@ int __cdecl night::compile_ns(int a1, int a2, int a3, int a4, unsigned int *a5, void *v38[15]; // [esp+180h] [ebp-98h] BYREF void *v39[23]; // [esp+1BCh] [ebp-5Ch] BYREF - std::string::operator=(a5, (char *)&byte_551F04); + std::string::operator=(a5, (char *)&byte_551F04); // "\0" memset(v17, 0, sizeof(v17)); night::NSStream::NSStream(v38, a1, a3, a4); v28[2] = (int)v28; @@ -22215,14 +22232,14 @@ void **__cdecl WXML::DOMLib::removern(void **a1, _DWORD *a2) char v3; // al struct _Unwind_Exception *lpuexcpt; // [esp+18h] [ebp-40h] - std::string::basic_string(a1, (char *)&byte_5537CA); + std::string::basic_string(a1, (char *)&byte_5537CA); // '\0' for ( lpuexcpt = 0; ; lpuexcpt = (struct _Unwind_Exception *)((char *)lpuexcpt + 1) ) { v2 = a2[1]; if ( (unsigned int)lpuexcpt >= v2 ) break; v3 = *((_BYTE *)lpuexcpt + *a2); - if ( v2 - 1 <= (unsigned int)lpuexcpt || v3 != 13 || *((_BYTE *)lpuexcpt + *a2 + 1) != 10 ) + if ( v2 - 1 <= (unsigned int)lpuexcpt || v3 != 13 || *((_BYTE *)lpuexcpt + *a2 + 1) != '\n'/*10*/ ) std::string::push_back(a1, v3); } return a1; @@ -23683,7 +23700,7 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( _DWORD *v107; // [esp+144h] [ebp-14h] int *v108; // [esp+148h] [ebp-10h] void *v109; // [esp+14Ch] [ebp-Ch] - + // DealSingleTokenToOps - 0 if ( a8 ) v11 = WXML::DOMLib::Token::ToString[abi:cxx11]((int)a5); else @@ -23694,11 +23711,12 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( v79 = 0; LOBYTE(v77[0]) = 0; v48 = WXML::StringTemplating::Deal(v12, (int)a2, (char **)&v77[1], v77); + // DealSingleTokenToOps - 5 if ( v48 ) { exception = __cxa_allocate_exception(0x18u); std::string::basic_string(&Block, "did you forget }}, ' or \""); - std::string::basic_string((void **)&v85, (char *)&byte_5537CA); + std::string::basic_string((void **)&v85, (char *)&byte_5537CA); // '\0' WXML::DOMLib::WXMLDom::Error((int)exception, a1, (int)a5, (int *)&v85, (int *)&Block); std::string::_M_dispose((void **)&v85); std::string::_M_dispose(&Block); @@ -23707,12 +23725,14 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } + // DealSingleTokenToOps - 10 if ( a8 ) { std::string::basic_string(&Block, "plain_text_marker"); v59 = (struct _Unwind_Exception *)(a11 + 4); v53 = *(struct _Unwind_Exception **)(a11 + 8); lpuexcpt = (struct _Unwind_Exception *)(a11 + 4); + // 寻找key为plain_text_marker的元素 while ( v53 ) { v13 = (unsigned __int8)std::operator<((int)v53 + 16, (int)&Block) == 0; @@ -23763,7 +23783,7 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( v86[0] = &v87; v86[1] = 0; v85 = 0; - std::string::operator=((unsigned int *)v86, (char *)&byte_5537CA); + std::string::operator=((unsigned int *)v86, (char *)&byte_5537CA); // '\0' lpuexcptb = *(struct _Unwind_Exception **)&v77[1]; if ( *(_DWORD **)&v77[1] != v78 && **(_DWORD **)&v77[1] == 1 ) { @@ -23800,6 +23820,7 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( if ( *(_DWORD **)&v77[1] != v78 && *(v78 - 7) == 1 ) std::vector::push_back((char **)&v77[1], &v85); lpuexcptc = 1; + // int v23 v23 = 0; while ( -1227133513 * (((int)v78 - *(_DWORD *)&v77[1]) >> 2) > lpuexcptc ) { @@ -23825,6 +23846,7 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( std::string::_M_dispose((void **)&v80); } } + // DealSingleTokenToOps - 15 if ( a7 ) { v25 = *(_DWORD **)&v77[1]; @@ -23836,12 +23858,14 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( } if ( v26 != a7 ) { + // a5.offset_56 a5[14] = -3; std::string::operator=(a5 + 15, "the very attr must be an expression (surrouned by `{{..}}`)"); v48 = -1; - goto LABEL_112; + goto LABEL_112; // 销毁数据,返回v48 } } + // DealSingleTokenToOps - 20 if ( v78 == *(_DWORD **)&v77[1] ) { v89 = (int)&v91; @@ -23853,6 +23877,7 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( std::vector::push_back((char **)&v77[1], &Block); std::string::_M_dispose((void **)&v89); } + // DealSingleTokenToOps - 25 v52 = 1; if ( (unsigned int)v78 - *(_DWORD *)&v77[1] <= 0x1C ) { @@ -23870,18 +23895,21 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( std::operator<<>(lpuexcptd, "[a,"); ++a9[1]; } - v27 = (const char *)&off_553AE9; + // DealSingleTokenToOps - 30 + v27 = (const char *)&off_553AE9; // "nt_" v51 = 0; if ( a8 ) v27 = "t_"; v47 = (char *)v27; - v28 = &byte_5537CA; + v28 = &byte_5537CA; // '\0' if ( a6 ) - v28 = (const char *)&unk_553AED; + v28 = (const char *)&unk_553AED; // "_d" v46 = (char *)v28; while ( -1227133513 * (((int)v78 - *(_DWORD *)&v77[1]) >> 2) > v51 ) { + // v51 下标,在递增 if ( v51 ) + // a3 std::operator<<>(lpuexcptd, ","); v83[1] = 0; v84 = 0; @@ -23892,9 +23920,9 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( if ( *v62 ) v29 = "e_"; std::string::operator=((unsigned int *)v83, v29); - std::string::append(v83, v47); + std::string::append(v83, v47); // v27 std::string::append(v83, (int)(v62 + 1)); - std::string::append(v83, v46); + std::string::append(v83, v46); // v28 v57 = (_DWORD *)a4[2]; v63 = a4 + 1; while ( v57 ) @@ -23961,10 +23989,10 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( v104 = v34; v108 = 0; v109 = 0; - std::string::basic_string((void **)&v85, (char *)&byte_5537CA); + std::string::basic_string((void **)&v85, (char *)&byte_5537CA); // '\0' v66 = WXML::EXPRLib::Parser::Parse( (int)&Block, - (char **)(*(_DWORD *)&v77[1] + v50 + 4), + (char **)(*(_DWORD *)&v77[1] + v50 + 4), // v77[i].offset_4 (int)&v85, 1, 1, @@ -23999,7 +24027,7 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( std::operator<<>(lpuexcptd, "']"); std::string::_M_dispose(&Block); } - v68 = *a9; + v68 = *a9; // a9 WXML::DOMLib::RVMOpCodePositionRecorder * v43 = -1; if ( v52 ) v43 = a9[1]; @@ -24034,7 +24062,7 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps( std::operator<<>(lpuexcptd, "z["); v39 = (std::ostream::sentry *)std::ostream::operator<<(v63[10]); std::operator<<>(v39, "][1]"); - goto LABEL_107; + goto LABEL_107; // a9.offset_4++ 下个循环 } std::operator<<>(lpuexcptd, "z["); v40 = v63[10]; @@ -24057,6 +24085,7 @@ LABEL_107: std::string::_M_dispose(v83); ++v51; } + // DealSingleTokenToOps - 35 if ( v52 ) std::operator<<>(lpuexcptd, "]"); v35 = *a9; @@ -24066,10 +24095,12 @@ LABEL_107: a9[1] = 0; *a9 = v35 + 1; while ( (v81 - v80) >> 5 > v67 ) - std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_emplace_unique>( + std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::_M_emplace_unique>( a4, (int)&v80[32 * v67++]); std::vector>::~vector((void ***)&v80); + // DealSingleTokenToOps - 40 if ( a10 ) { lpuexcpte = std::operator<<>(lpuexcptd, ",['"); @@ -24086,6 +24117,7 @@ LABEL_107: { std::operator<<>(lpuexcptd, ")\n"); } + // DealSingleTokenToOps - 45 LABEL_112: std::vector::~vector((void **)&v77[1]); return v48; @@ -24114,8 +24146,10 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderAllOpsAndRecord( } else { + // this->offset_60 this->offset_52 for ( i = this[15]; (_DWORD *)i != this + 13; i = std::_Rb_tree_increment(i) ) { + // i + 40 -> second if ( *(_DWORD *)(i + 60) && !std::operator==((int)this, "import") && !std::operator==((int)this, "include") ) @@ -24131,6 +24165,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderAllOpsAndRecord( } } } + // this[18] -> this->offset_72 for ( j = 0; j < (this[19] - this[18]) >> 3; ++j ) WXML::DOMLib::WXMLDom::RenderAllOpsAndRecord((int)a2, (int)a3, a4, (int)a5, (int)a6, a7, a8); } @@ -25809,7 +25844,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( std::string::_M_dispose((void **)&v155); __cxa_throw( exception, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } v148 = 0; @@ -25823,15 +25858,19 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( v110 = 0; while ( 1 ) { + // this->offset_72 v15 = this[18]; - if ( (this[19] - v15) >> 3 <= v137 ) + if ( (this[19] - v15) >> 3 <= v137 ) // v137是下标,在递增 break; + // v15 this->offset_72 + // this->offset_72[i] if ( (std::operator==(*(_DWORD *)(v15 + 8 * v137), "import") || std::operator==(*(_DWORD *)(this[18] + 8 * v137), "wx-import")) - && (v124 = *(_DWORD *)(this[18] + 8 * v137), + && (v124 = *(_DWORD *)(this[18] + 8 * v137), // this->offset_72[i] v101 = (_DWORD *)(v124 + 52), - std::string::basic_string((void **)&v155, (char *)off_5539C8), - v125 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + std::string::basic_string((void **)&v155, (char *)off_5539C8), // "src" + v125 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( (_DWORD *)(v124 + 48), (int)&v155), std::string::_M_dispose((void **)&v155), @@ -25844,8 +25883,8 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( v17 = std::operator<<(v16, v145); v18 = std::operator<<>(v17, "="); v19 = std::operator<<(v18, a3); - std::operator<<>(v19, (char *)off_553FDC); - v130 = (_DWORD *)this[62]; + std::operator<<>(v19, (char *)off_553FDC); // [x[ + v130 = (_DWORD *)this[62]; // this.offset_248 std::string::basic_string((char *)&v155, (int)a2); StrID = WXML::DOMLib::StrCache::GetStrID(v130, (int)&v155); std::ostream::operator<<(StrID); @@ -25857,11 +25896,14 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( } else if ( std::operator==(*(_DWORD *)(this[18] + 8 * v137), "include") ) { + // this->offset_72[i] + // int v131 v131 = *(_DWORD *)(this[18] + 8 * v137); - v126 = (_DWORD *)(v131 + 52); - std::string::basic_string((void **)&v155, (char *)off_5539C8); - v132 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - (_DWORD *)(v131 + 48), + v126 = (_DWORD *)(v131 + 52); // cur->offset_48.end() + std::string::basic_string((void **)&v155, (char *)off_5539C8); // "src" + v132 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + (_DWORD *)(v131 + 48), // cur->offset_48 (int)&v155); std::string::_M_dispose((void **)&v155); if ( v132 != v126 ) @@ -25873,7 +25915,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( v23 = std::operator<<(v22, v147); v24 = std::operator<<>(v23, "="); v25 = std::operator<<(v24, a3); - std::operator<<>(v25, (char *)off_553FDC); + std::operator<<>(v25, (char *)off_553FDC); // "[x[" v133 = (_DWORD *)this[62]; std::string::basic_string((char *)&v155, (int)a2); v26 = WXML::DOMLib::StrCache::GetStrID(v133, (int)&v155); @@ -25886,30 +25928,34 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( } } ++v137; - } + } // end while + // RenderChildren - 5 v150 = 0; v149[0] = &v150; v149[1] = 0; v127 = 0; for ( i = 0; ; i = Stra ) { + // this->offset_72 v28 = this[18]; if ( (this[19] - v28) >> 3 <= v127 ) break; - Strc = *(char **)(v28 + 8 * v127); + Strc = *(char **)(v28 + 8 * v127); // cur v102 = Strc + 52; std::string::basic_string((void **)v153, "wx-if"); - v29 = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - (_DWORD *)Strc + 12, - (int)v153); + v29 = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + (_DWORD *)Strc + 12, // Strc.offset_48 + (int)v153); // "wx-if" Str = 1; if ( v102 == v29 ) { - Strd = *(char **)(this[18] + 8 * v127); + Strd = *(char **)(this[18] + 8 * v127); // cur std::string::basic_string((void **)&v155, "wx:if"); - Str = Strd + 52 != (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - (_DWORD *)Strd + 12, - (int)&v155); + Str = Strd + 52 != (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + (_DWORD *)Strd + 12,// Strd.offset_48 + (int)&v155); // "wx:if" std::string::_M_dispose((void **)&v155); } std::string::_M_dispose((void **)v153); @@ -25922,19 +25968,21 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( } else { - Stre = *(char **)(this[18] + 8 * v127); - v103 = Stre + 52; + Stre = *(char **)(this[18] + 8 * v127); // cur + v103 = Stre + 52; // offset_52 std::string::basic_string((void **)v151, "wx:elif"); - Strf = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - (_DWORD *)Stre + 12, + Strf = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + (_DWORD *)Stre + 12, //offset_48 (int)v151); std::string::_M_dispose((void **)v151); if ( v103 == Strf ) { - Strg = *(char **)(this[18] + 8 * v127); + Strg = *(char **)(this[18] + 8 * v127); // cur v104 = Strg + 52; std::string::basic_string((void **)v153, "wx:else"); - Strh = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + Strh = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( (_DWORD *)Strg + 12, (int)v153); std::string::_M_dispose((void **)v153); @@ -25950,7 +25998,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( std::string::_M_dispose((void **)&v155); __cxa_throw( v106, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } v31 = *(_DWORD *)(this[18] + 8 * v127); @@ -25971,7 +26019,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( std::string::_M_dispose((void **)&v155); __cxa_throw( v105, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } Stra = i + 1; @@ -25981,7 +26029,8 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( } } ++v127; - } + }// end while + // RenderChildren - 10 v152 = 0; v151[0] = (int)&v152; v151[1] = 0; @@ -25991,8 +26040,10 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( for ( j = 0; (this[19] - this[18]) >> 3 > j; ++j ) { std::string::_M_assign((int)v151, (int)a5); + // this->offset_72[j].offset_244 if ( *(int *)(*(_DWORD *)(this[18] + 8 * j) + 244) <= 0 ) goto LABEL_56; + // this->offset_72[j].offset_244 > 0 v154 = 0; v153[0] = (int)&v154; v153[1] = 0; @@ -26000,14 +26051,15 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( while ( 1 ) { Strb = *v98; - v96 = *(_DWORD *)(this[18] + 8 * j); + v96 = *(_DWORD *)(this[18] + 8 * j); // cur if ( !*v98 ) break; - v95 = *(_DWORD *)(this[18] + 8 * j) + 52; + v95 = *(_DWORD *)(this[18] + 8 * j) + 52; // cur->offset_52 std::string::basic_string((void **)&v155, Strb); - v97 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - (_DWORD *)(v96 + 48), - (int)&v155); + v97 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + (_DWORD *)(v96 + 48), // cur->offset_48 + (int)&v155); // Strb v98 std::string::_M_dispose((void **)&v155); ++v98; if ( v97 != (_DWORD *)v95 ) @@ -26017,7 +26069,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( } } if ( *((_DWORD *)std::map::operator[]( - (_DWORD *)(*(_DWORD *)(this[18] + 8 * j) + 48), + (_DWORD *)(*(_DWORD *)(this[18] + 8 * j) + 48), // cur->offset_48 (int)v153) + 14) == -3 ) { @@ -26032,7 +26084,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( WXML::DOMLib::WXMLDom::Error((int)v107, a2, (int)v32, v153, v136); __cxa_throw( v107, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } if ( *((_DWORD *)std::map::operator[]( @@ -26047,7 +26099,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( std::string::_M_dispose((void **)&v155); __cxa_throw( v108, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } if ( std::operator==((int)v153, "wx-if") || std::operator==((int)v153, "wx:if") ) @@ -26064,7 +26116,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( std::operator<<>(v40, a12); std::operator<<>(v135, "if(_oz(z,"); v41 = std::map::operator[]( - (_DWORD *)(*(_DWORD *)(this[18] + 8 * j) + 48), + (_DWORD *)(*(_DWORD *)(this[18] + 8 * j) + 48), // cur->offset_48 (int)v153); std::ostream::operator<<(*((_DWORD *)v41 + 14)); v42 = std::operator<<>(v135, ","); @@ -26098,7 +26150,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderChildren( v50 = *(_DWORD *)(this[18] + 8 * j); if ( !*(_BYTE *)(v50 + 256) ) goto LABEL_55; -LABEL_54: + LABEL_54: std::string::basic_string((char *)&v155, v50 + 220); v157 = 3; std::vector>::emplace_back>((int)&v142, &v155); @@ -26125,30 +26177,32 @@ LABEL_54: if ( *(_BYTE *)(v50 + 256) ) goto LABEL_54; } -LABEL_55: + LABEL_55: std::string::_M_assign((int)v151, *(_DWORD *)(this[18] + 8 * j) + 220); std::string::_M_dispose((void **)v153); -LABEL_56: + // end this->offset_72[j].offset_244 > 0 + LABEL_56: if ( std::operator==(*(_DWORD *)(this[18] + 8 * j), "import") || std::operator==(*(_DWORD *)(this[18] + 8 * j), "wx-import") ) { - Stri = *(char **)(this[18] + 8 * j); + Stri = *(char **)(this[18] + 8 * j); // cur v99 = Stri + 52; - std::string::basic_string((void **)&v155, (char *)off_5539C8); + std::string::basic_string((void **)&v155, (char *)off_5539C8); // "src" Strj = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - (_DWORD *)Stri + 12, - (int)&v155); + (_DWORD *)Stri + 12, // cur->offset_48 + (int)&v155); // src std::string::_M_dispose((void **)&v155); if ( v99 != Strj ) { v63 = std::operator<<>(v135, "_ai("); v64 = std::operator<<(v63, v145); - std::operator<<>(v64, (char *)off_553CC8); + std::operator<<>(v64, (char *)off_553CC8); // ",x[" v100 = (_DWORD *)this[62]; Strk = *(char **)(this[18] + 8 * j); - std::string::basic_string((void **)v153, (char *)off_5539C8); - v65 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - (_DWORD *)Strk + 12, + std::string::basic_string((void **)v153, (char *)off_5539C8); // "src" + v65 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + (_DWORD *)Strk + 12, // cur->offset_48 (int)v153); v66 = WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)(v65 + 10)); std::string::basic_string((char *)&v155, v66); @@ -26159,7 +26213,7 @@ LABEL_56: std::operator<<>(v135, "],"); v68 = std::operator<<(v135, a3); std::operator<<>(v68, (char *)off_553CC8); - Strl = (char *)this[62]; + Strl = (char *)this[62]; // 248 std::string::basic_string((char *)&v155, (int)a2); v69 = WXML::DOMLib::StrCache::GetStrID(Strl, (int)&v155); std::ostream::operator<<(v69); @@ -26208,7 +26262,7 @@ LABEL_56: a13, a14, a15); -LABEL_73: + LABEL_73: std::string::_M_dispose((void **)&v155); goto LABEL_74; } @@ -26266,13 +26320,14 @@ LABEL_73: } } } -LABEL_74: + LABEL_74: if ( *(int *)(*(_DWORD *)(this[18] + 8 * j) + 244) > 0 ) { v87 = std::operator<<>(v135, "}"); std::operator<<>(v87, a12); } } + // RenderChildren - 15 for ( lpuexcpta = 0; (unsigned int)lpuexcpta < -1227133513 * ((v143 - (int)v142) >> 2); lpuexcpta = (struct _Unwind_Exception *)((char *)lpuexcpta + 1) ) @@ -26282,18 +26337,21 @@ LABEL_74: v89 = (std::ostream::sentry *)std::ostream::operator<<(v142[7 * (_DWORD)lpuexcpta + 6]); std::operator<<>(v89, a12); } + // RenderChildren - 20 for ( lpuexcptb = 0; v110 != lpuexcptb; lpuexcptb = (struct _Unwind_Exception *)((char *)lpuexcptb + 1) ) { v90 = std::operator<<(v135, v145); v91 = std::operator<<>(v90, ".pop()"); std::operator<<>(v91, a12); } + // RenderChildren - 25 for ( lpuexcptc = 0; v109 != lpuexcptc; lpuexcptc = (struct _Unwind_Exception *)((char *)lpuexcptc + 1) ) { v92 = std::operator<<(v135, v147); v93 = std::operator<<>(v92, ".pop()"); std::operator<<>(v93, a12); } + // RenderChildren - 30 std::vector>::~vector(&v142); std::string::_M_dispose((void **)v151); std::string::_M_dispose(v149); @@ -29822,44 +29880,44 @@ int __cdecl WXML::StringTemplating::Deal(char *Str, int a2, char **a3, _BYTE *a4 v17 = 0; while ( 1 ) { - v6 = *((_BYTE *)lpuexcpt + (_DWORD)Str); + v6 = *((_BYTE *)lpuexcpt + (_DWORD)Str); // v6 = Str[lpuexcpt] if ( (int)lpuexcpt >= v16 || !v6 ) break; v7 = *((_BYTE *)lpuexcpt + (_DWORD)Str + 1); if ( v17 == 2 ) { - if ( v6 == 92 ) + if ( v6 == '\\'/*92*/ ) goto LABEL_37; - v11 = v6 == 34; -LABEL_39: + v11 = v6 == '"'/*34*/; + LABEL_39: v12 = 1; -LABEL_40: + LABEL_40: if ( !v11 ) v12 = v17; v17 = v12; - goto LABEL_44; + goto LABEL_44; // ++ next while } if ( v17 > 2 ) { - if ( v6 == 92 ) + if ( v6 == '\\'/*92*/ ) { -LABEL_37: + LABEL_37: lpuexcpt = (struct _Unwind_Exception *)((char *)lpuexcpt + 1); - goto LABEL_44; + goto LABEL_44; // ++ next while } - v11 = v6 == 39; + v11 = v6 == '\''/*39*/; goto LABEL_39; } if ( v17 ) { - if ( v6 != 125 || v7 != 125 ) + if ( v6 != '}'/*125*/ || v7 != '}'/*125*/ ) { - if ( v6 == 34 ) + if ( v6 == '"'/*34*/ ) { v17 = 2; - goto LABEL_44; + goto LABEL_44; // ++ next while } - v11 = v6 == 39; + v11 = v6 == '\''/*39*/; v12 = 4; goto LABEL_40; } @@ -29869,20 +29927,20 @@ LABEL_37: while ( 1 ) { v9 = Str[v5]; - if ( v9 != 32 && v9 != 9 ) + if ( v9 != ' '/*32*/ && v9 != '\t'/*9*/ ) break; ++v5; } while ( v5 < (int)v8 ) { v10 = v8[(_DWORD)Str]; - if ( v10 != 32 && v10 != 9 ) + if ( v10 != ' '/*32*/ && v10 != '\t'/*9*/ ) goto LABEL_30; --v8; } if ( (char *)v5 != v8 ) goto LABEL_31; -LABEL_30: + LABEL_30: v21 = v23; v22 = 0; v23[0] = 0; @@ -29895,12 +29953,12 @@ LABEL_30: *a4 = 1; std::string::_M_dispose((void **)&v21); } -LABEL_31: + LABEL_31: v17 = 0; v5 = (int)lpuexcpt + 2; lpuexcpt = (struct _Unwind_Exception *)((char *)lpuexcpt + 1); } - else if ( v6 == 123 && v7 == 123 ) + else if ( v6 == '{'/*123*/ && v7 == '{'/*123*/ ) { if ( (int)lpuexcpt > v5 ) { @@ -29919,9 +29977,9 @@ LABEL_31: v5 = (int)lpuexcpt + 2; lpuexcpt = (struct _Unwind_Exception *)((char *)lpuexcpt + 1); } -LABEL_44: + LABEL_44: lpuexcpt = (struct _Unwind_Exception *)((char *)lpuexcpt + 1); - } + } // end while if ( v17 ) return 1; v13 = ~((unsigned int)lpuexcpt - v16); @@ -53558,12 +53616,14 @@ void __thiscall night::NSASTParse::NSASTParse(int this, int a2, int a3, int a4) *(_DWORD *)(this + 48) = 0; *(_BYTE *)(this + 52) = 0; *(_DWORD *)(this + 44) = this + 52; + *(_DWORD *)(this + 32) = 0; *(_DWORD *)(this + 28) = a3; + *(_DWORD *)(this + 36) = 0; *(_DWORD *)(this + 24) = a4; *(_DWORD *)(this + 40) = 0; - std::string::operator=((unsigned int *)(this + 44), (char *)&byte_551F04); + std::string::operator=((unsigned int *)(this + 44), (char *)&byte_551F04); // "\0" } //----- (00471F5C) -------------------------------------------------------- @@ -177306,8 +177366,8 @@ char *__thiscall std::_Rb_tree /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/cmd1.txt" > /root/github/wx-compiler/test/wcc_win.json