mirror of
https://github.com/matrix-construct/construct
synced 2024-11-28 17:52:54 +01:00
ircd: Fix various grammars for karma rule interposition.
This commit is contained in:
parent
08c35bac0f
commit
83cb332216
2 changed files with 8 additions and 10 deletions
|
@ -45,10 +45,6 @@ namespace ircd::lex
|
|||
static string_view cast(const mutable_buffer &, T);
|
||||
}
|
||||
|
||||
//TODO: XXX try removing once karma rules are optimized for globals
|
||||
#define RULE_INIT_PRIO \
|
||||
__attribute__((init_priority(65535))), apply_to=variable(is_global)
|
||||
|
||||
#pragma GCC visibility push(internal)
|
||||
namespace ircd::lex
|
||||
{
|
||||
|
@ -65,7 +61,6 @@ namespace ircd::lex
|
|||
extern const rule_from<double()> from_double;
|
||||
extern const rule_from<long double()> from_long_double;
|
||||
|
||||
#pragma clang attribute push(RULE_INIT_PRIO)
|
||||
extern const rule_to<bool> to_bool, is_bool;
|
||||
extern const rule_to<int8_t> to_int8_t, is_int8_t;
|
||||
extern const rule_to<uint8_t> to_uint8_t, is_uint8_t;
|
||||
|
@ -78,7 +73,6 @@ namespace ircd::lex
|
|||
extern const rule_to<float> to_float, is_float;
|
||||
extern const rule_to<double> to_double, is_double;
|
||||
extern const rule_to<long double> to_long_double, is_long_double;
|
||||
#pragma clang attribute pop
|
||||
}
|
||||
#pragma GCC visibility pop
|
||||
|
||||
|
|
|
@ -245,6 +245,7 @@ ircd::rfc1459::gen::grammar
|
|||
grammar() noexcept;
|
||||
};
|
||||
|
||||
/*
|
||||
struct [[gnu::visibility("internal")]]
|
||||
ircd::rfc1459::gen::carriage
|
||||
:gen::grammar<karma::ostream_iterator<char>>
|
||||
|
@ -284,6 +285,7 @@ ircd::rfc1459::gen::generate_prefix
|
|||
generate_prefix() = default;
|
||||
}
|
||||
const ircd::rfc1459::gen::generate_prefix;
|
||||
*/
|
||||
|
||||
template<class it>
|
||||
ircd::rfc1459::gen::grammar<it>::grammar()
|
||||
|
@ -392,7 +394,7 @@ std::ostream &
|
|||
ircd::rfc1459::operator<<(std::ostream &s, const parv &parv)
|
||||
{
|
||||
using karma::delimit;
|
||||
|
||||
/*
|
||||
ssize_t i(0);
|
||||
karma::ostream_iterator<char> osi(s);
|
||||
for(; i < ssize_t(parv.size()) - 1; ++i)
|
||||
|
@ -402,27 +404,29 @@ ircd::rfc1459::operator<<(std::ostream &s, const parv &parv)
|
|||
if(!parv.empty())
|
||||
if(!karma::generate(osi, gen::generate_trailing, parv.at(parv.size() - 1)))
|
||||
throw syntax_error("Invalid trailing parameter");
|
||||
|
||||
*/
|
||||
return s;
|
||||
}
|
||||
|
||||
std::ostream &
|
||||
ircd::rfc1459::operator<<(std::ostream &s, const cmd &cmd)
|
||||
{
|
||||
/*
|
||||
karma::ostream_iterator<char> osi(s);
|
||||
if(!karma::generate(osi, gen::generate_command, cmd))
|
||||
throw syntax_error("Bad command or numeric name");
|
||||
|
||||
*/
|
||||
return s;
|
||||
}
|
||||
|
||||
std::ostream &
|
||||
ircd::rfc1459::operator<<(std::ostream &s, const pfx &pfx)
|
||||
{
|
||||
/*
|
||||
karma::ostream_iterator<char> osi(s);
|
||||
if(!karma::generate(osi, gen::generate_prefix, pfx))
|
||||
throw syntax_error("Invalid prefix");
|
||||
|
||||
*/
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue