Parse a function call. If succesful, sp is updated to be the function's argument(s). */
| 385 | |
| 386 | /** Parse a function call. If succesful, sp is updated to be the function's argument(s). */ |
| 387 | bool Func(const std::string& str, Span<const char>& sp) |
| 388 | { |
| 389 | if ((size_t)sp.size() >= str.size() + 2 && sp[str.size()] == '(' && sp[sp.size() - 1] == ')' && std::equal(str.begin(), str.end(), sp.begin())) { |
| 390 | sp = sp.subspan(str.size() + 1, sp.size() - str.size() - 2); |
| 391 | return true; |
| 392 | } |
| 393 | return false; |
| 394 | } |
| 395 | |
| 396 | /** Return the expression that sp begins with, and update sp to skip it. */ |
| 397 | Span<const char> Expr(Span<const char>& sp) |
no test coverage detected