diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index e693804..5507360 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -438,15 +438,20 @@ namespace chaiscript } - /// Reads a symbol group from input if it matches the parameter, without skipping initial whitespace - #define Symbol_(t_s, len) \ - ( \ - m_position.remaining() >= len \ - ? std::memcmp(t_s, &(*m_position), len) == 0 \ - ? ((m_position += len),true) \ - :false \ - :false \ - ) + /// Reads a symbol group from input if it matches the parameter, without skipping initial whitespace + inline bool Symbol_(const char *t_s, const size_t len) + { + if (m_position.remaining() >= len) { + const char *file_pos = &(*m_position); + for (size_t pos = 0; pos < len; ++pos) + { + if (t_s[pos] != file_pos[pos]) { return false; } + } + m_position += len; + return true; + } + return false; + } /// Skips any multi-line or single-line comment bool SkipComment() { @@ -2540,8 +2545,6 @@ namespace chaiscript } } -#undef Symbol_ - #if defined(CHAISCRIPT_MSVC) && defined(CHAISCRIPT_PUSHED_MIN_MAX) #undef CHAISCRIPT_PUSHED_MIN_MAX #pragma pop_macro("min")