From 6caffa6a23befba0d7a7e4f39e08928ba317866a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 4 Oct 2009 11:38:44 +0200 Subject: Add support for option name aliases and string literals --- cli/parser.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'cli/parser.cxx') diff --git a/cli/parser.cxx b/cli/parser.cxx index 54ab78a..55c609a 100644 --- a/cli/parser.cxx +++ b/cli/parser.cxx @@ -405,7 +405,20 @@ option_def (token& t) case token::t_string_lit: { if (valid_) - nl.push_back (t.literal ()); + { + // Get rid of '"'. + // + string r; + string const& l (t.literal ()); + + for (size_t i (0), n (l.size ()); i < n; ++i) + { + if (l[i] != '"' || (i != 0 && l[i - 1] == '\\')) + r += l[i]; + } + + nl.push_back (r); + } break; } -- cgit v1.1