diff --git a/chaiscript/chaiscript_parser.hpp b/chaiscript/chaiscript_parser.hpp index 569a033..c7f0655 100644 --- a/chaiscript/chaiscript_parser.hpp +++ b/chaiscript/chaiscript_parser.hpp @@ -1132,12 +1132,12 @@ namespace chaiscript if (Dot_Access()) { retval = true; - if (Symbol("*", true) || Symbol("/", true)) { + if (Symbol("*", true) || Symbol("/", true) || Symbol("%", true)) { do { if (!Dot_Access()) { throw Parse_Error("Incomplete math expression", File_Position(line, col), filename); } - } while (retval && (Symbol("*", true) || Symbol("/", true))); + } while (retval && (Symbol("*", true) || Symbol("/", true) || Symbol("%", true))); build_match(Token_Type::Multiplicative, prev_stack_top); } diff --git a/chaiscript/chaiscript_prelude.hpp b/chaiscript/chaiscript_prelude.hpp index 10178bb..c9ab7e2 100644 --- a/chaiscript/chaiscript_prelude.hpp +++ b/chaiscript/chaiscript_prelude.hpp @@ -8,7 +8,7 @@ const char *chaiscript_prelude = " \ def to_string(x) : call_exists(first, x) && call_exists(second, x) { \n\ \"<\" + x.first.to_string() + \", \" + x.second.to_string() + \">\"\n\ }\n\ -def to_string(x) : !is_type(\"string\", x) && call_exists(range, x) { \n\ +def to_string(x) : call_exists(range, x) && !is_type(\"string\", x){ \n\ \"[\" + x.join(\", \") + \"]\"\n\ }\n\ def to_string(x) { \n\