From feea901e4d2dbc464272bb53546c7ff392e015ad Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Sun, 30 Oct 2022 01:26:26 +0800 Subject: [PATCH] :art: improve code format delete option -v, --version, -l, --lex --- main.cpp | 75 ++++++------- makefile | 19 ++-- module/makefile | 9 +- nasal_ast.h | 73 +++--------- nasal_codegen.h | 4 +- nasal_dbg.h | 6 +- nasal_err.h | 58 +++++----- nasal_import.h | 24 ++-- nasal_lexer.h | 127 ++++++++++----------- nasal_parse.h | 255 +++++++++++++++++++++++++----------------- test/calc.nas | 1 + test/donuts.nas | 51 +++++++++ test/md5compare.nas | 1 + test/wavecollapse.nas | 2 +- 14 files changed, 381 insertions(+), 324 deletions(-) create mode 100644 test/donuts.nas diff --git a/main.cpp b/main.cpp index 3820220..5393bde 100644 --- a/main.cpp +++ b/main.cpp @@ -15,50 +15,48 @@ using ch_clk=std::chrono::high_resolution_clock; -const u32 VM_TOKEN =0x01; -const u32 VM_AST =0x02; -const u32 VM_CODE =0x04; -const u32 VM_TIME =0x08; -const u32 VM_EXEC =0x10; -const u32 VM_DETAIL=0x20; -const u32 VM_DEBUG =0x40; -const u32 VM_OPT =0x80; +const u32 VM_AST =0x01; +const u32 VM_CODE =0x02; +const u32 VM_TIME =0x04; +const u32 VM_EXEC =0x08; +const u32 VM_DETAIL=0x10; +const u32 VM_DEBUG =0x20; +const u32 VM_OPT =0x40; -void help() +std::ostream& help(std::ostream& out) { - std::clog + out <<" ,--#-,\n" <<"<3 / \\____\\ <3\n" <<" |_|__A_|\n" #ifdef _WIN32 - <<"use command if want to use unicode.\n" + <<"use command to use unicode.\n" #endif - <<"nasal