17 if ((
size_t)sp.
size() >= str.size() && std::equal(str.begin(), str.end(), sp.
begin())) {
26 if ((
size_t)sp.
size() >= str.size() + 2 && sp[str.size()] ==
'(' && sp[sp.
size() - 1] ==
')' && std::equal(str.begin(), str.end(), sp.
begin())) {
27 sp = sp.
subspan(str.size() + 1, sp.
size() - str.size() - 2);
37 while (it != sp.
end()) {
38 if (*it ==
'(' || *it ==
'{') {
40 }
else if (level && (*it ==
')' || *it ==
'}')) {
42 }
else if (level == 0 && (*it ==
')' || *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
bool Const(const std::string &str, Span< const char > &sp)
Parse a constant.
Span< const char > Expr(Span< const char > &sp)
Extract the expression that sp begins with.
bool Func(const std::string &str, Span< const char > &sp)
Parse a function call.