From 577546763f7542c3a7b24c03fe64a27321e1aba9 Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Thu, 14 Oct 2021 23:22:28 +0800 Subject: [PATCH] change function name and cli format --- README.md | 2 +- main.cpp | 132 +++++++++++++++++++++++------------------------ nasal.h | 24 ++++----- nasal_ast.h | 38 +++++++------- nasal_builtin.h | 6 +-- nasal_codegen.h | 28 ++++------ nasal_gc.h | 36 ++++++++----- nasal_import.h | 23 ++++----- nasal_lexer.h | 42 +++++++-------- nasal_parse.h | 8 +-- nasal_vm.h | 24 ++++----- test/hexdump.nas | 53 +++++++++---------- 12 files changed, 203 insertions(+), 213 deletions(-) diff --git a/README.md b/README.md index dad99c2..f517ab4 100644 --- a/README.md +++ b/README.md @@ -904,7 +904,7 @@ nasal_ref builtin_print(std::vector& local,nasal_gc& gc) ``` After that, register the built-in function's name(in nasal) and the function's pointer in this table: ```C++ -struct FUNC_TABLE +struct func { const char* name; nasal_ref (*func)(std::vector&,nasal_gc&); diff --git a/main.cpp b/main.cpp index ab6a625..a58a054 100644 --- a/main.cpp +++ b/main.cpp @@ -1,24 +1,28 @@ #include "nasal.h" - +#define VM_LEXINFO 1 +#define VM_ASTINFO 2 +#define VM_CODEINFO 4 +#define VM_EXECTIME 8 +#define VM_OPCALLNUM 16 +#define VM_EXEC 32 void help_cmd() { std::cout #ifdef _WIN32 <<"use command \'chcp 65001\' if want to use unicode.\n" #endif - <<"nasal [option]\n" + <<"nasal