diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index 2d31971..a4886ce 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -208,7 +208,7 @@ namespace chaiscript std::vector m_conversions; template - void apply(InItr begin, InItr end, T &t) const + static void apply(InItr begin, InItr end, T &t) { while (begin != end) { @@ -223,7 +223,7 @@ namespace chaiscript } template - void apply_globals(InItr begin, InItr end, T &t) const + static void apply_globals(InItr begin, InItr end, T &t) { while (begin != end) { @@ -233,7 +233,7 @@ namespace chaiscript } template - void apply_single(InItr begin, InItr end, T &t) const + static void apply_single(InItr begin, InItr end, T &t) { while (begin != end) { @@ -243,7 +243,7 @@ namespace chaiscript } template - void apply_eval(InItr begin, InItr end, T &t) const + static void apply_eval(InItr begin, InItr end, T &t) { while (begin != end) { @@ -484,16 +484,16 @@ namespace chaiscript add_object(name, obj); } - + /** * Adds a named object to the current scope */ - void add_object(const std::string &name, const Boxed_Value &obj) + void add_object(const std::string &name, const Boxed_Value &obj) const { StackData &stack = get_stack_data(); validate_object_name(name); - + Scope &scope = stack.back(); auto itr = scope.find(name); if (itr != stack.back().end()) @@ -987,7 +987,7 @@ namespace chaiscript return get_type_name(obj.get_type_info()); } - State get_state() + State get_state() const { chaiscript::detail::threading::shared_lock l(m_mutex); chaiscript::detail::threading::shared_lock l2(m_global_object_mutex); diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index 6491375..a5b3de1 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -372,7 +372,7 @@ namespace chaiscript /// Helper function for loading a file - std::string load_file(const std::string &t_filename) { + static std::string load_file(const std::string &t_filename) { std::ifstream infile(t_filename.c_str(), std::ios::in | std::ios::ate | std::ios::binary ); if (!infile.is_open()) { diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index 471ca8c..99de4be 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -200,7 +200,7 @@ namespace chaiscript /** * test a char in an m_alphabet */ - bool char_in_alphabet(unsigned char c, detail::Alphabet a) { return m_alphabet[a][c]; } + bool char_in_alphabet(unsigned char c, detail::Alphabet a) const { return m_alphabet[a][c]; } /** * Prints the parsed ast_nodes as a tree @@ -217,7 +217,7 @@ namespace chaiscript /** * Shows the current stack of matched ast_nodes */ - void show_match_stack() { + void show_match_stack() const { for (auto & elem : m_match_stack) { //debug_print(match_stack[i]); std::cout << elem->to_string(); @@ -280,7 +280,7 @@ namespace chaiscript /** * Check to see if there is more text parse */ - inline bool has_more_input() { + inline bool has_more_input() const { return (m_input_pos != m_input_end); } @@ -466,7 +466,7 @@ namespace chaiscript return retval; } - Boxed_Value buildFloat(const std::string &t_val) + static Boxed_Value buildFloat(const std::string &t_val) { bool float_ = false; bool long_ = false; @@ -508,7 +508,7 @@ namespace chaiscript template - Boxed_Value buildInt(const IntType &t_type, const std::string &t_val) + static Boxed_Value buildInt(const IntType &t_type, const std::string &t_val) { bool unsigned_ = false; bool long_ = false;