diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-19 09:27:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-19 09:27:31 +0200 |
commit | 3e34f8ac2ba3b719f13a8f9ef7422cbee8b02192 (patch) | |
tree | 251bf64a4c2e793c94b635afd6bb27e00bbc3be2 /cli/runtime-source.cxx | |
parent | 248625ac8a5e200e6a86f5c27f60c20dc06c01a6 (diff) | |
download | cli-3e34f8ac2ba3b719f13a8f9ef7422cbee8b02192.tar.gz cli-3e34f8ac2ba3b719f13a8f9ef7422cbee8b02192.tar.xz cli-3e34f8ac2ba3b719f13a8f9ef7422cbee8b02192.zip |
Fix std::map parser implementation
Diffstat (limited to 'cli/runtime-source.cxx')
-rw-r--r-- | cli/runtime-source.cxx | 10 |
1 files 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<char*> (o), 0};" - << "if (!kstr.empty ())" + << "char* av[] = {const_cast<char*> (o), 0};"; + if (sp) + os << "bool dummy;"; + os << "if (!kstr.empty ())" << "{" << "av[1] = const_cast<char*> (kstr.c_str ());" << "argv_scanner s (0, ac, av);" - << "parser<K>::parse (k, s);" + << "parser<K>::parse (k, " << (sp ? "dummy, " : "") << "s);" << "}" << "if (!vstr.empty ())" << "{" << "av[1] = const_cast<char*> (vstr.c_str ());" << "argv_scanner s (0, ac, av);" - << "parser<V>::parse (v, s);" + << "parser<V>::parse (v, " << (sp ? "dummy, " : "") << "s);" << "}" << "m[k] = v;" << "}" |