From 80ef21b0b92db70f1ed22b9c5feb1e726ff8a09f Mon Sep 17 00:00:00 2001 From: Valk Richard Li <48872266+ValKmjolnir@users.noreply.github.com> Date: Thu, 21 Nov 2019 22:14:21 +0800 Subject: [PATCH] Fixed bugs --- balloon/abstract_syntax_tree.cpp | 10 +++++----- balloon/balloon_lexer.h | 17 ++++++++++++++++- balloon/main.cpp | 15 +++++++++++---- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/balloon/abstract_syntax_tree.cpp b/balloon/abstract_syntax_tree.cpp index 8fd2dd6..f0ffea6 100644 --- a/balloon/abstract_syntax_tree.cpp +++ b/balloon/abstract_syntax_tree.cpp @@ -698,7 +698,7 @@ void abstract_syntax_tree::run_root() } else { - std::cout<<">>[Runtime-error] line "<>[Runtime-error] line "<line<<": redeclaration of \'"<<_name<<"\'."<run_loop(); if(ret_type==__return) { - std::cout<<"[Runtime-error] line "<line<<": incorrect use of break/continue."<run_ifelse(); if(ret_type==__continue || ret_type==__break || ret_type==__return) { - std::cout<<"[Runtime-error] line "<line<<": incorrect use of break/continue."<>[Runtime-error] line "<>[Runtime-error] line "<line<<": redeclaration of \'"<<_name<<"\'."<line<<": incorrect use of break/continue."<::iterator i=libsource.begin();i!=libsource.end();++i) + { + if(32<=*i && *i<128 || *i=='\n') + std::cout<<*i; + else if(*i=='\t') + std::cout<<" "; + if(*i=='\n') + { + ++line; + std::cout<::iterator i=resource.begin();i!=resource.end();++i) { if(32<=*i && *i<128 || *i=='\n') diff --git a/balloon/main.cpp b/balloon/main.cpp index 360d376..90eeeed 100644 --- a/balloon/main.cpp +++ b/balloon/main.cpp @@ -25,7 +25,8 @@ int main() std::cout<<">> 7. [del ] |delete program in memory."<> 8. [run ] |run the programme in stack. (-lexer -parser)"<> 9. [rs ] |check the source program."<>10. [sound ] |make noise(?)."<>10. [total ] |check code with lib."<>11. [sound ] |make noise(?)."<