From e2a50a61e665812f5b606bfddf8ba3b1774e81ab Mon Sep 17 00:00:00 2001 From: Valk Richard Li <48872266+ValKmjolnir@users.noreply.github.com> Date: Mon, 19 Oct 2020 07:40:43 -0700 Subject: [PATCH] update --- version3.0/main.cpp | 30 +++++++++++++++--------------- version3.0/nasal_lexer.h | 26 ++++++++++++++++---------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/version3.0/main.cpp b/version3.0/main.cpp index 804a830..17974c6 100644 --- a/version3.0/main.cpp +++ b/version3.0/main.cpp @@ -27,11 +27,11 @@ void help() void logo() { - std::cout<<" __ _ "<> [Delete] complete."<> [Delete] complete.\n"; return; } void die(std::string stage,std::string filename) { - std::cout<<">> ["<: error(s) occurred,stop."<> ["<: error(s) occurred,stop.\n"; return; } @@ -180,19 +180,19 @@ int main() #endif logo(); #ifdef _WIN32 - std::cout<<">> [system] Windows system."<> [system] Windows system.\n"; #endif #ifdef _linux_ - std::cout<<">> [system] Linux system."<> [system] Linux system.\n"; #endif #ifdef TARGET_OS_MAC - std::cout<<">> [system] MacOS system."<> [system] MacOS system.\n"; #endif - std::cout<<">> Nasal interpreter ver 3.0 ."<> Code: https://github.com/ValKmjolnir/Nasal-Interpreter"<> Info: http://wiki.flightgear.org/Nasal_scripting_language"<> Input \"help\" to get help ."<> Nasal interpreter ver 3.0 .\n"; + std::cout<<">> Code: https://github.com/ValKmjolnir/Nasal-Interpreter\n"; + std::cout<<">> Info: http://wiki.flightgear.org/Nasal_scripting_language\n"; + std::cout<<">> Input \"help\" to get help .\n"; while(1) { std::cout<<">> "; @@ -238,7 +238,7 @@ int main() std::ifstream fin(command); if(fin.fail()) { - std::cout<<">> [file] cannot open file \""<> [file] cannot open file \""<& res,int& ptr,int& line) { int res_size=res.size(); std::string token_str=""; - char str_begin=res[ptr]; - ++ptr; + char str_begin=res[ptr++]; if(ptr>=res_size) return token_str; while(ptr=res_size) { ++error; - std::cout<<">> [lexer] line "<> [lexer] line "<