From b3112bd3f6d0887fdf81610327c9edad08a0cfaf Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 10 Jan 2015 17:32:49 -0800 Subject: Use generated config for map --- src/map/script-parse.cpp | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'src/map/script-parse.cpp') diff --git a/src/map/script-parse.cpp b/src/map/script-parse.cpp index 6b41225..fb306c5 100644 --- a/src/map/script-parse.cpp +++ b/src/map/script-parse.cpp @@ -36,6 +36,7 @@ #include "../ast/script.hpp" +#include "globals.hpp" #include "map.t.hpp" #include "script-buffer.hpp" #include "script-call.hpp" @@ -46,6 +47,8 @@ namespace tmwa { +namespace map +{ constexpr bool DEBUG_DISP = false; class ScriptBuffer @@ -77,15 +80,18 @@ public: return ZString(strings::really_construct_from_a_pointer, reinterpret_cast(&script_buf[i]), nullptr); } }; +} // namespace map } // namespace tmwa -void std::default_delete::operator()(const tmwa::ScriptBuffer *sd) +void std::default_delete::operator()(const tmwa::map::ScriptBuffer *sd) { really_delete1 sd; } namespace tmwa { +namespace map +{ // implemented for script-call.hpp because reasons ByteCode ScriptPointer::peek() const { return (*TRY_UNWRAP(code, abort()))[pos]; } ByteCode ScriptPointer::pop() { return (*TRY_UNWRAP(code, abort()))[pos++]; } @@ -97,15 +103,6 @@ ZString ScriptPointer::pops() return rv; } -Map str_datam; -static -str_data_t LABEL_NEXTLINE_; - -Map scriptlabel_db; -static -std::set probable_labels; -UPMap userfunc_db; - static struct ScriptConfigParse { @@ -119,12 +116,6 @@ struct ScriptConfigParse int warn_cmd_mismatch_paramnum = 1; } script_config; -static -int parse_cmd_if = 0; -static -Option> parse_cmdp = None; - -InternPool variable_names; Option> search_strp(XString p) { @@ -307,14 +298,6 @@ ZString::iterator skip_word(ZString::iterator p) return p; } -// TODO: replace this whole mess with some sort of input stream that works -// a line at a time. -static -ZString startptr; -static -int startline; - -int script_errors = 0; /*========================================== * エラーメッセージ出力 *------------------------------------------ @@ -864,4 +847,5 @@ void ScriptBuffer::parse_script(ZString src, int line, bool implicit_end) } PRINTF("\n"_fmt); } +} // namespace map } // namespace tmwa -- cgit v1.2.3-60-g2f50