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/source.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'cli/source.cxx') diff --git a/cli/source.cxx b/cli/source.cxx index e9e4365..afac17e 100644 --- a/cli/source.cxx +++ b/cli/source.cxx @@ -65,14 +65,21 @@ namespace virtual void traverse (type& o) { - string name (ename (o)); + using semantics::names; + + string member (emember (o)); string type (o.type ().name ()); string scope (escape (o.scope ().name ())); string map ("_cli_" + scope + "_map_"); - os << "_cli_" << scope << "_map_[\"" << o.name () << "\"] = " << endl - << "&::cli::thunk<" << scope << ", " << type << ", " << - "&" << scope << "::" << emember (o) << ">;"; + names& n (o.named ()); + + for (names::name_iterator i (n.name_begin ()); i != n.name_end (); ++i) + { + os << "_cli_" << scope << "_map_[\"" << *i << "\"] = " << endl + << "&::cli::thunk<" << scope << ", " << type << ", " << + "&" << scope << "::" << member << ">;"; + } } }; -- cgit v1.1