15 if (
size_t(sp.
size()) >= str.size() &&
16 std::equal(str.begin(), str.end(), sp.
begin())) {
24 if (
size_t(sp.
size()) >= str.size() + 2 && sp[str.size()] ==
'(' &&
25 sp[sp.
size() - 1] ==
')' &&
26 std::equal(str.begin(), str.end(), sp.
begin())) {
27 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 ==
',')) {
A Span is an object that can refer to a contiguous sequence of objects.
constexpr std::size_t size() const noexcept
CONSTEXPR_IF_NOT_DEBUG Span< C > subspan(std::size_t offset) const noexcept
CONSTEXPR_IF_NOT_DEBUG Span< C > first(std::size_t count) const noexcept
constexpr C * begin() const noexcept
constexpr C * end() const noexcept
Span< const char > Expr(Span< const char > &sp)
Extract the expression that sp begins with.
bool Const(const std::string &str, Span< const char > &sp)
Parse a constant.
bool Func(const std::string &str, Span< const char > &sp)
Parse a function call.