diff --git a/src/include/wxml.h b/src/include/wxml.h index 3f0a566..f2da799 100644 --- a/src/include/wxml.h +++ b/src/include/wxml.h @@ -206,7 +206,7 @@ namespace WXML /* data */ std::string fileContent; std::string fileName; - WXML::DOMLib::Machine machine; // this + 2 + WXML::DOMLib::Machine machine; // this->offset_8 public: Tokenizer(char const* fileContent, std::string const& filePath); Tokenizer(/* args */); diff --git a/src/wxml/compiler.cpp b/src/wxml/compiler.cpp index 4f2f702..1a8f9af 100644 --- a/src/wxml/compiler.cpp +++ b/src/wxml/compiler.cpp @@ -26,7 +26,7 @@ namespace WXML{ bool b1, // mark指定运算结果是否非0 a12 bool b2) // mark指定运算结果是否非0 a13 { - int pResult; + int pResult = 0; bool isWxml = filePath.substr(filePath.length() - 5) == ".wxml"; if (isWxml) { @@ -235,6 +235,10 @@ namespace WXML{ (mark & 4) != 0, // a11 -> mark a12 (mark & 0x20) != 0); // a13 // printf("parse result: %d", parseResult); + if (parseResult) + { + return parseResult; + } } // mark - 5 std::shared_ptr v301_localCommonStream1(new std::stringstream()); // v301 @@ -295,7 +299,7 @@ namespace WXML{ for (auto j: i.second) { info << j << " "; - if (v304.find( j) == v304.end()) + if (v304.find(j) == v304.end()) { errorMessage = "WXML file not found: " + j; return -1152; diff --git a/src/wxml/dom_lib/tokenizer.cpp b/src/wxml/dom_lib/tokenizer.cpp index 42128b6..912c352 100644 --- a/src/wxml/dom_lib/tokenizer.cpp +++ b/src/wxml/dom_lib/tokenizer.cpp @@ -8,6 +8,7 @@ namespace WXML Tokenizer::Tokenizer(char const* fileContent, std::string const& filePath) { this->fileContent = std::string(fileContent); + this->fileContent.resize(this->fileContent.size() + 1); this->fileName = filePath; WXML::DOMLib::Machine m(filePath); this->machine = m;