mirror of
https://github.com/matrix-construct/construct
synced 2024-05-30 00:33:49 +02:00
ircd: Fix various grammars for karma rule interposition.
This commit is contained in:
parent
08c35bac0f
commit
83cb332216
|
@ -45,10 +45,6 @@ namespace ircd::lex
|
||||||
static string_view cast(const mutable_buffer &, T);
|
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)
|
#pragma GCC visibility push(internal)
|
||||||
namespace ircd::lex
|
namespace ircd::lex
|
||||||
{
|
{
|
||||||
|
@ -65,7 +61,6 @@ namespace ircd::lex
|
||||||
extern const rule_from<double()> from_double;
|
extern const rule_from<double()> from_double;
|
||||||
extern const rule_from<long double()> from_long_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<bool> to_bool, is_bool;
|
||||||
extern const rule_to<int8_t> to_int8_t, is_int8_t;
|
extern const rule_to<int8_t> to_int8_t, is_int8_t;
|
||||||
extern const rule_to<uint8_t> to_uint8_t, is_uint8_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<float> to_float, is_float;
|
||||||
extern const rule_to<double> to_double, is_double;
|
extern const rule_to<double> to_double, is_double;
|
||||||
extern const rule_to<long double> to_long_double, is_long_double;
|
extern const rule_to<long double> to_long_double, is_long_double;
|
||||||
#pragma clang attribute pop
|
|
||||||
}
|
}
|
||||||
#pragma GCC visibility pop
|
#pragma GCC visibility pop
|
||||||
|
|
||||||
|
|
|
@ -245,6 +245,7 @@ ircd::rfc1459::gen::grammar
|
||||||
grammar() noexcept;
|
grammar() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
struct [[gnu::visibility("internal")]]
|
struct [[gnu::visibility("internal")]]
|
||||||
ircd::rfc1459::gen::carriage
|
ircd::rfc1459::gen::carriage
|
||||||
:gen::grammar<karma::ostream_iterator<char>>
|
:gen::grammar<karma::ostream_iterator<char>>
|
||||||
|
@ -284,6 +285,7 @@ ircd::rfc1459::gen::generate_prefix
|
||||||
generate_prefix() = default;
|
generate_prefix() = default;
|
||||||
}
|
}
|
||||||
const ircd::rfc1459::gen::generate_prefix;
|
const ircd::rfc1459::gen::generate_prefix;
|
||||||
|
*/
|
||||||
|
|
||||||
template<class it>
|
template<class it>
|
||||||
ircd::rfc1459::gen::grammar<it>::grammar()
|
ircd::rfc1459::gen::grammar<it>::grammar()
|
||||||
|
@ -392,7 +394,7 @@ std::ostream &
|
||||||
ircd::rfc1459::operator<<(std::ostream &s, const parv &parv)
|
ircd::rfc1459::operator<<(std::ostream &s, const parv &parv)
|
||||||
{
|
{
|
||||||
using karma::delimit;
|
using karma::delimit;
|
||||||
|
/*
|
||||||
ssize_t i(0);
|
ssize_t i(0);
|
||||||
karma::ostream_iterator<char> osi(s);
|
karma::ostream_iterator<char> osi(s);
|
||||||
for(; i < ssize_t(parv.size()) - 1; ++i)
|
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(!parv.empty())
|
||||||
if(!karma::generate(osi, gen::generate_trailing, parv.at(parv.size() - 1)))
|
if(!karma::generate(osi, gen::generate_trailing, parv.at(parv.size() - 1)))
|
||||||
throw syntax_error("Invalid trailing parameter");
|
throw syntax_error("Invalid trailing parameter");
|
||||||
|
*/
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream &
|
std::ostream &
|
||||||
ircd::rfc1459::operator<<(std::ostream &s, const cmd &cmd)
|
ircd::rfc1459::operator<<(std::ostream &s, const cmd &cmd)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
karma::ostream_iterator<char> osi(s);
|
karma::ostream_iterator<char> osi(s);
|
||||||
if(!karma::generate(osi, gen::generate_command, cmd))
|
if(!karma::generate(osi, gen::generate_command, cmd))
|
||||||
throw syntax_error("Bad command or numeric name");
|
throw syntax_error("Bad command or numeric name");
|
||||||
|
*/
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream &
|
std::ostream &
|
||||||
ircd::rfc1459::operator<<(std::ostream &s, const pfx &pfx)
|
ircd::rfc1459::operator<<(std::ostream &s, const pfx &pfx)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
karma::ostream_iterator<char> osi(s);
|
karma::ostream_iterator<char> osi(s);
|
||||||
if(!karma::generate(osi, gen::generate_prefix, pfx))
|
if(!karma::generate(osi, gen::generate_prefix, pfx))
|
||||||
throw syntax_error("Invalid prefix");
|
throw syntax_error("Invalid prefix");
|
||||||
|
*/
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue