From 3e34f8ac2ba3b719f13a8f9ef7422cbee8b02192 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Nov 2015 09:27:31 +0200 Subject: Fix std::map parser implementation --- cli/runtime-source.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/runtime-source.cxx b/cli/runtime-source.cxx index 36d5e3f..be29a57 100644 --- a/cli/runtime-source.cxx +++ b/cli/runtime-source.cxx @@ -608,18 +608,20 @@ generate_runtime_source (context& ctx, bool complete) << "std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ()));" << endl << "int ac (2);" - << "char* av[] = {const_cast (o), 0};" - << "if (!kstr.empty ())" + << "char* av[] = {const_cast (o), 0};"; + if (sp) + os << "bool dummy;"; + os << "if (!kstr.empty ())" << "{" << "av[1] = const_cast (kstr.c_str ());" << "argv_scanner s (0, ac, av);" - << "parser::parse (k, s);" + << "parser::parse (k, " << (sp ? "dummy, " : "") << "s);" << "}" << "if (!vstr.empty ())" << "{" << "av[1] = const_cast (vstr.c_str ());" << "argv_scanner s (0, ac, av);" - << "parser::parse (v, s);" + << "parser::parse (v, " << (sp ? "dummy, " : "") << "s);" << "}" << "m[k] = v;" << "}" -- cgit v1.1