From 31ffcfa8597ede496c1e889a4ae4716b6bbded73 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 21 Dec 2018 13:48:03 -0800 Subject: [PATCH] ircd::m::id: De-template grammars and assume iterator type; minor fixes. --- include/ircd/m/id.h | 4 ++-- ircd/m/id.cc | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/ircd/m/id.h b/include/ircd/m/id.h index 693cedcad..09ff5d1f9 100644 --- a/include/ircd/m/id.h +++ b/include/ircd/m/id.h @@ -50,8 +50,8 @@ struct ircd::m::id enum sigil :char; template struct buf; - template struct input; - template struct output; + struct input; + struct output; struct parser; struct printer; struct validator; diff --git a/ircd/m/id.cc b/ircd/m/id.cc index d52f4aa23..5210479c5 100644 --- a/ircd/m/id.cc +++ b/ircd/m/id.cc @@ -17,11 +17,11 @@ namespace ircd::m [[noreturn]] void failure(const qi::expectation_failure &, const string_view &); } -template struct ircd::m::id::input -:qi::grammar +:qi::grammar { using id = m::id; + using it = const char *; template using rule = qi::rule; // Sigils @@ -145,7 +145,7 @@ struct ircd::m::id::input }; /// https://tools.ietf.org/html/rfc3986 Appendix A - const rule<> ip6_addr[10] + const rule<> ip6_addr[9] { { repeat(6)[ip6_piece] >> ip6_ls32 }, { lit("::") >> repeat(5)[ip6_piece] >> ip6_ls32 }, @@ -223,10 +223,10 @@ struct ircd::m::id::input {} }; -template struct ircd::m::id::output -:karma::grammar +:karma::grammar { + using it = char *; template using rule = karma::rule; output() @@ -235,7 +235,7 @@ struct ircd::m::id::output }; struct ircd::m::id::parser -:input +:input { string_view operator()(const id::sigil &, const string_view &id) const; string_view operator()(const string_view &id) const; @@ -300,7 +300,7 @@ catch(const qi::expectation_failure &e) } struct ircd::m::id::validator -:input +:input { void operator()(const id::sigil &sigil, const string_view &id) const; void operator()(const string_view &id) const; @@ -357,7 +357,7 @@ catch(const qi::expectation_failure &e) //TODO: abstract this pattern with ircd::json::printer in ircd/spirit.h struct ircd::m::id::printer -:output +:output { template