16 if ((
size_t)sp.
size() >= str.size() && std::equal(str.begin(), str.end(), sp.
begin())) {
25 if ((
size_t)sp.
size() >= str.size() + 2 && sp[str.size()] ==
'(' && sp[sp.
size() - 1] ==
')' && std::equal(str.begin(), str.end(), sp.
begin())) {
26 sp = sp.
subspan(str.size() + 1, sp.
size() - str.size() - 2);
36 while (
it != sp.
end()) {
39 }
else if (level && *
it ==
')') {
41 }
else if (level == 0 && (*
it ==
')' || *
it ==
',')) {
53 std::vector<Span<const char>> ret;
56 while (
it != sp.
end()) {
58 ret.emplace_back(start,
it);
63 ret.emplace_back(start,
it);
CONSTEXPR_IF_NOT_DEBUG Span< C > first(std::size_t count) const noexcept
CONSTEXPR_IF_NOT_DEBUG Span< C > subspan(std::size_t offset) const noexcept
std::deque< CInv >::iterator it
bool Func(const std::string &str, Span< const char > &sp)
Parse a function call.
constexpr C * end() const noexcept
bool Const(const std::string &str, Span< const char > &sp)
Parse a constant.
constexpr std::size_t size() const noexcept
std::vector< Span< const char > > Split(const Span< const char > &sp, char sep)
Split a string on every instance of sep, returning a vector.
Span< const char > Expr(Span< const char > &sp)
Extract the expression that sp begins with.
constexpr C * begin() const noexcept
A Span is an object that can refer to a contiguous sequence of objects.