From 21aec59ad3234a1d07a1222fc05c4f8f904aee37 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Tue, 23 Mar 2021 23:32:25 +0100 Subject: [PATCH] rename namespace to cubescript --- include/cubescript/cubescript.hh | 4 ++-- include/cubescript/cubescript_conf.hh | 4 ++-- src/cs_bcode.cc | 4 ++-- src/cs_bcode.hh | 4 ++-- src/cs_error.cc | 4 ++-- src/cs_gen.cc | 4 ++-- src/cs_ident.cc | 4 ++-- src/cs_ident.hh | 4 ++-- src/cs_parser.cc | 4 ++-- src/cs_parser.hh | 4 ++-- src/cs_state.cc | 4 ++-- src/cs_state.hh | 4 ++-- src/cs_std.hh | 4 ++-- src/cs_strman.cc | 4 ++-- src/cs_strman.hh | 4 ++-- src/cs_val.cc | 6 +++--- src/cs_vm.cc | 4 ++-- src/cs_vm.hh | 4 ++-- src/lib_base.cc | 4 ++-- src/lib_list.cc | 4 ++-- src/lib_math.cc | 4 ++-- src/lib_str.cc | 4 ++-- tools/repl.cc | 2 +- 23 files changed, 46 insertions(+), 46 deletions(-) diff --git a/include/cubescript/cubescript.hh b/include/cubescript/cubescript.hh index cb15111..eecb728 100644 --- a/include/cubescript/cubescript.hh +++ b/include/cubescript/cubescript.hh @@ -35,7 +35,7 @@ # endif #endif -namespace cscript { +namespace cubescript { static_assert(std::is_integral_v, "integer_type must be integral"); static_assert(std::is_signed_v, "integer_type must be signed"); @@ -989,6 +989,6 @@ inline R print_stack(R writer, stack_state const &st) { return writer; } -} /* namespace cscript */ +} /* namespace cubescript */ #endif /* LIBCUBESCRIPT_CUBESCRIPT_HH */ diff --git a/include/cubescript/cubescript_conf.hh b/include/cubescript/cubescript_conf.hh index b8d2928..f2e5b53 100644 --- a/include/cubescript/cubescript_conf.hh +++ b/include/cubescript/cubescript_conf.hh @@ -1,13 +1,13 @@ #ifndef LIBCUBESCRIPT_CUBESCRIPT_CONF_HH #define LIBCUBESCRIPT_CUBESCRIPT_CONF_HH -namespace cscript { +namespace cubescript { using integer_type = int; using float_type = float; constexpr auto const INT_FORMAT = "%d"; constexpr auto const FLOAT_FORMAT = "%.7g"; constexpr auto const ROUND_FLOAT_FORMAT = "%.1f"; -} /* namespace cscript */ +} /* namespace cubescript */ #endif /* LIBCUBESCRIPT_CUBESCRIPT_CONF_HH */ diff --git a/src/cs_bcode.cc b/src/cs_bcode.cc index 9171e02..d323c2c 100644 --- a/src/cs_bcode.cc +++ b/src/cs_bcode.cc @@ -1,7 +1,7 @@ #include "cs_bcode.hh" #include "cs_state.hh" -namespace cscript { +namespace cubescript { /* public API impls */ @@ -133,4 +133,4 @@ bcode *bcode_get_empty(empty_block *empty, std::size_t val) { return &empty[val].init + 1; } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/cs_bcode.hh b/src/cs_bcode.hh index 39645bb..2aebcbe 100644 --- a/src/cs_bcode.hh +++ b/src/cs_bcode.hh @@ -6,7 +6,7 @@ #include #include -namespace cscript { +namespace cubescript { struct bcode { std::uint32_t init; @@ -88,6 +88,6 @@ empty_block *bcode_init_empty(internal_state *cs); void bcode_free_empty(internal_state *cs, empty_block *empty); bcode *bcode_get_empty(empty_block *empty, std::size_t val); -} /* namespace cscript */ +} /* namespace cubescript */ #endif diff --git a/src/cs_error.cc b/src/cs_error.cc index 3fb5fab..34b5fa4 100644 --- a/src/cs_error.cc +++ b/src/cs_error.cc @@ -2,7 +2,7 @@ #include "cs_vm.hh" -namespace cscript { +namespace cubescript { LIBCUBESCRIPT_EXPORT char *error::request_buf( state &cs, std::size_t bufs, char *&sp @@ -80,4 +80,4 @@ LIBCUBESCRIPT_EXPORT stack_state error::save_stack(state &cs) { return stack_state(cs, ret, total > dalias->get_value()); } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/cs_gen.cc b/src/cs_gen.cc index 6429723..e9f8366 100644 --- a/src/cs_gen.cc +++ b/src/cs_gen.cc @@ -8,7 +8,7 @@ #include #include -namespace cscript { +namespace cubescript { std::string_view codegen_state::get_str() { size_t nl; @@ -1468,4 +1468,4 @@ void codegen_state::gen_main(std::string_view s, int ret_type) { code.push_back(BC_INST_EXIT | ((ret_type < VAL_ANY) ? (ret_type << BC_INST_RET) : 0)); } -} /* namespace cscript */ \ No newline at end of file +} /* namespace cubescript */ \ No newline at end of file diff --git a/src/cs_ident.cc b/src/cs_ident.cc index 66eaa4e..a53b9a5 100644 --- a/src/cs_ident.cc +++ b/src/cs_ident.cc @@ -3,7 +3,7 @@ #include "cs_bcode.hh" #include "cs_vm.hh" -namespace cscript { +namespace cubescript { ident_impl::ident_impl(ident_type tp, string_ref nm, int fl): p_name{nm}, p_type{int(tp)}, p_flags{fl} @@ -416,4 +416,4 @@ LIBCUBESCRIPT_EXPORT int command::get_num_args() const { return static_cast(this)->p_numargs; } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/cs_ident.hh b/src/cs_ident.hh index a99a186..626bce1 100644 --- a/src/cs_ident.hh +++ b/src/cs_ident.hh @@ -3,7 +3,7 @@ #include -namespace cscript { +namespace cubescript { enum { ID_UNKNOWN = -1, ID_IVAR, ID_FVAR, ID_SVAR, ID_COMMAND, ID_ALIAS, @@ -114,6 +114,6 @@ struct command_impl: ident_impl, command { bool ident_is_used_arg(ident *id, state &cs); -} /* namespace cscript */ +} /* namespace cubescript */ #endif diff --git a/src/cs_parser.cc b/src/cs_parser.cc index 7854348..e8d0583 100644 --- a/src/cs_parser.cc +++ b/src/cs_parser.cc @@ -5,7 +5,7 @@ #include "cs_std.hh" -namespace cscript { +namespace cubescript { /* string/word parsers are also useful to have public */ @@ -425,4 +425,4 @@ LIBCUBESCRIPT_EXPORT void list_parser::skip_until_item() { } } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/cs_parser.hh b/src/cs_parser.hh index 601efc3..6e34b12 100644 --- a/src/cs_parser.hh +++ b/src/cs_parser.hh @@ -5,13 +5,13 @@ #include -namespace cscript { +namespace cubescript { integer_type parse_int(std::string_view input, std::string_view *end = nullptr); float_type parse_float(std::string_view input, std::string_view *end = nullptr); bool is_valid_name(std::string_view input); -} /* namespace cscript */ +} /* namespace cubescript */ #endif diff --git a/src/cs_state.cc b/src/cs_state.cc index 29c1d0e..7ef3331 100644 --- a/src/cs_state.cc +++ b/src/cs_state.cc @@ -6,7 +6,7 @@ #include "cs_vm.hh" // FIXME, only Max Arguments #include "cs_parser.hh" -namespace cscript { +namespace cubescript { internal_state::internal_state(alloc_func af, void *data): allocf{af}, aptr{data}, @@ -787,4 +787,4 @@ LIBCUBESCRIPT_EXPORT void state::init_libs(int libs) { } } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/cs_state.hh b/src/cs_state.hh index ecb85bb..2f52e78 100644 --- a/src/cs_state.hh +++ b/src/cs_state.hh @@ -8,7 +8,7 @@ #include "cs_bcode.hh" -namespace cscript { +namespace cubescript { struct state; struct internal_state; @@ -111,6 +111,6 @@ inline void std_allocator::deallocate(T *p, std::size_t n) { istate->alloc(p, n, 0); } -} /* namespace cscript */ +} /* namespace cubescript */ #endif diff --git a/src/cs_std.hh b/src/cs_std.hh index 246ad30..e328f47 100644 --- a/src/cs_std.hh +++ b/src/cs_std.hh @@ -10,7 +10,7 @@ #include "cs_state.hh" -namespace cscript { +namespace cubescript { /* run func, call the second one after finishing */ @@ -120,6 +120,6 @@ struct charbuf: valbuf { } }; -} /* namespace cscript */ +} /* namespace cubescript */ #endif diff --git a/src/cs_strman.cc b/src/cs_strman.cc index bec9bd3..2b2db06 100644 --- a/src/cs_strman.cc +++ b/src/cs_strman.cc @@ -2,7 +2,7 @@ #include "cs_strman.hh" -namespace cscript { +namespace cubescript { struct string_ref_state { std::size_t length; @@ -157,4 +157,4 @@ LIBCUBESCRIPT_EXPORT bool string_ref::operator==(string_ref const &s) const { return p_str == s.p_str; } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/cs_strman.hh b/src/cs_strman.hh index d115174..ab93712 100644 --- a/src/cs_strman.hh +++ b/src/cs_strman.hh @@ -9,7 +9,7 @@ #include "cs_std.hh" #include "cs_state.hh" -namespace cscript { +namespace cubescript { struct string_ref_state; @@ -87,6 +87,6 @@ struct string_pool { > counts; }; -} /* namespace cscript */ +} /* namespace cubescript */ #endif diff --git a/src/cs_val.cc b/src/cs_val.cc index 53e9813..bc4560f 100644 --- a/src/cs_val.cc +++ b/src/cs_val.cc @@ -5,7 +5,7 @@ #include -namespace cscript { +namespace cubescript { static std::string_view intstr(integer_type v, charbuf &buf) { buf.reserve(32); @@ -340,7 +340,7 @@ bool any_value::code_is_empty() const { if (get_type() != value_type::CODE) { return true; } - return cscript::code_is_empty(csv_get(p_stor)); + return cubescript::code_is_empty(csv_get(p_stor)); } bool any_value::get_bool() const { @@ -454,4 +454,4 @@ LIBCUBESCRIPT_EXPORT string_ref concat_values( return string_ref{cs, buf.str()}; } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/cs_vm.cc b/src/cs_vm.cc index 0d32675..87c8512 100644 --- a/src/cs_vm.cc +++ b/src/cs_vm.cc @@ -6,7 +6,7 @@ #include #include -namespace cscript { +namespace cubescript { static inline bool ident_has_cb(ident *id) { if (!id->is_command() && !id->is_special()) { @@ -1517,4 +1517,4 @@ loop_state state::run_loop(bcode *code) { return run_loop(code, ret); } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/cs_vm.hh b/src/cs_vm.hh index 541fd42..41e8bc1 100644 --- a/src/cs_vm.hh +++ b/src/cs_vm.hh @@ -12,7 +12,7 @@ #include "cs_bcode.hh" #include "cs_ident.hh" -namespace cscript { +namespace cubescript { static constexpr int MaxArguments = 25; static constexpr int MaxResults = 7; @@ -225,6 +225,6 @@ static void call_with_args(state &cs, F body) { }); } -} /* namespace cscript */ +} /* namespace cubescript */ #endif /* LIBCUBESCRIPT_VM_HH */ diff --git a/src/lib_base.cc b/src/lib_base.cc index c33eb56..d8cce84 100644 --- a/src/lib_base.cc +++ b/src/lib_base.cc @@ -4,7 +4,7 @@ #include "cs_ident.hh" #include "cs_vm.hh" // FIXME, only Max Arguments -namespace cscript { +namespace cubescript { static inline void do_loop( state &cs, ident &id, integer_type offset, integer_type n, integer_type step, @@ -341,4 +341,4 @@ end: }); } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/lib_list.cc b/src/lib_list.cc index 2a6ccf4..2e6d748 100644 --- a/src/lib_list.cc +++ b/src/lib_list.cc @@ -5,7 +5,7 @@ #include "cs_std.hh" #include "cs_parser.hh" -namespace cscript { +namespace cubescript { template struct arg_val; @@ -642,4 +642,4 @@ static void init_lib_list_sort(state &gcs) { }); } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/lib_math.cc b/src/lib_math.cc index 2033523..6d908fd 100644 --- a/src/lib_math.cc +++ b/src/lib_math.cc @@ -6,7 +6,7 @@ #include -namespace cscript { +namespace cubescript { static constexpr float_type PI = 3.14159265358979f; static constexpr float_type RAD = PI / 180.0f; @@ -364,4 +364,4 @@ void init_lib_math(state &cs) { }); } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/src/lib_str.cc b/src/lib_str.cc index 1252415..03a3dd6 100644 --- a/src/lib_str.cc +++ b/src/lib_str.cc @@ -6,7 +6,7 @@ #include "cs_std.hh" #include "cs_strman.hh" -namespace cscript { +namespace cubescript { template static inline void str_cmp_by( @@ -233,4 +233,4 @@ void init_lib_string(state &cs) { }); } -} /* namespace cscript */ +} /* namespace cubescript */ diff --git a/tools/repl.cc b/tools/repl.cc index ef13527..40428b5 100644 --- a/tools/repl.cc +++ b/tools/repl.cc @@ -9,7 +9,7 @@ #include -namespace cs = cscript; +namespace cs = cubescript; std::string_view version = "CubeScript 0.0.1";