15 if (
size_t(
sp.size()) >= str.size() &&
16 std::equal(str.begin(), str.end(),
sp.begin())) {
17 sp =
sp.subspan(str.size());
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 ==
',')) {
47 sp =
sp.subspan(it -
sp.begin());
A Span is an object that can refer to a contiguous sequence of objects.
CONSTEXPR_IF_NOT_DEBUG Span< C > first(std::size_t count) const noexcept
constexpr C * begin() 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.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...