Parse a constant.
Declared in <script/parsing.h>
bool
Const(
std::string const& str,
std::span<char const>& sp,
bool skip = true);
If sp's initial part matches str, sp is optionally updated to skip that part, and true is returned. Otherwise sp is unmodified and false is returned.
true if sp begins with str, false otherwise.
| Name | Description |
|---|---|
| str | The constant text to match against the start of sp. |
| sp | The input span; on a match it is advanced past the constant when skip is true. |
| skip | Whether to advance sp past the matched constant. |