From aafc60b2e9014f542999fb4579e9636e39747749 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 20 Mar 2023 17:00:30 +0300 Subject: Regenerate options parsing files --- xsd/xsd/pregenerated/xsd/cxx/options.cxx | 50 +++++++++++++++++++++++++ xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx | 50 +++++++++++++++++++++++++ xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx | 50 +++++++++++++++++++++++++ xsd/xsd/pregenerated/xsd/options.cxx | 50 +++++++++++++++++++++++++ 4 files changed, 200 insertions(+) diff --git a/xsd/xsd/pregenerated/xsd/cxx/options.cxx b/xsd/xsd/pregenerated/xsd/cxx/options.cxx index f4d3fa7..24532f5 100644 --- a/xsd/xsd/pregenerated/xsd/cxx/options.cxx +++ b/xsd/xsd/pregenerated/xsd/cxx/options.cxx @@ -184,6 +184,56 @@ namespace cli } }; + template + struct parser > + { + static void + parse (std::multimap& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (v, dummy, s); + } + + m.insert (typename std::multimap::value_type (k, v)); + } + else + throw missing_value (o); + + xs = true; + } + }; + template void thunk (X& x, scanner& s) diff --git a/xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx b/xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx index 04cb7ae..60667ac 100644 --- a/xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx +++ b/xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx @@ -184,6 +184,56 @@ namespace cli } }; + template + struct parser > + { + static void + parse (std::multimap& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (v, dummy, s); + } + + m.insert (typename std::multimap::value_type (k, v)); + } + else + throw missing_value (o); + + xs = true; + } + }; + template void thunk (X& x, scanner& s) diff --git a/xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx b/xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx index 60ddeb0..17214c1 100644 --- a/xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx +++ b/xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx @@ -184,6 +184,56 @@ namespace cli } }; + template + struct parser > + { + static void + parse (std::multimap& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (v, dummy, s); + } + + m.insert (typename std::multimap::value_type (k, v)); + } + else + throw missing_value (o); + + xs = true; + } + }; + template void thunk (X& x, scanner& s) diff --git a/xsd/xsd/pregenerated/xsd/options.cxx b/xsd/xsd/pregenerated/xsd/options.cxx index 34b0ff5..8da0ff5 100644 --- a/xsd/xsd/pregenerated/xsd/options.cxx +++ b/xsd/xsd/pregenerated/xsd/options.cxx @@ -677,6 +677,56 @@ namespace cli } }; + template + struct parser > + { + static void + parse (std::multimap& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser::parse (v, dummy, s); + } + + m.insert (typename std::multimap::value_type (k, v)); + } + else + throw missing_value (o); + + xs = true; + } + }; + template void thunk (X& x, scanner& s) -- cgit v1.1