diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-10 17:32:49 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-23 01:57:20 -0800 |
commit | b3112bd3f6d0887fdf81610327c9edad08a0cfaf (patch) | |
tree | e1b1099468399a3b22852a5947a3cac47da904ca /src/map/script-parse.cpp | |
parent | c482e420bcf447073ffe3ff8a106a0561e0baadd (diff) | |
download | tmwa-b3112bd3f6d0887fdf81610327c9edad08a0cfaf.tar.gz tmwa-b3112bd3f6d0887fdf81610327c9edad08a0cfaf.tar.bz2 tmwa-b3112bd3f6d0887fdf81610327c9edad08a0cfaf.tar.xz tmwa-b3112bd3f6d0887fdf81610327c9edad08a0cfaf.zip |
Use generated config for map
Diffstat (limited to 'src/map/script-parse.cpp')
-rw-r--r-- | src/map/script-parse.cpp | 32 |
1 files changed, 8 insertions, 24 deletions
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<const char *>(&script_buf[i]), nullptr); } }; +} // namespace map } // namespace tmwa -void std::default_delete<const tmwa::ScriptBuffer>::operator()(const tmwa::ScriptBuffer *sd) +void std::default_delete<const tmwa::map::ScriptBuffer>::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<RString, str_data_t> str_datam; -static -str_data_t LABEL_NEXTLINE_; - -Map<ScriptLabel, int> scriptlabel_db; -static -std::set<ScriptLabel> probable_labels; -UPMap<RString, const ScriptBuffer> 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<Borrowed<str_data_t>> parse_cmdp = None; - -InternPool variable_names; Option<Borrowed<str_data_t>> 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 |