Closed lefticus closed 3 months ago
Updated link: https://compiler-explorer.com/z/6dM54GMd4
Coming in Ep426
Just nitpicking. You can insert minus sign in the middle of the "parsed string".
int main() {
auto parser = make_int_parser();
auto result = parser('3');
result = parser('-'); // <-
result = parser('2');
assert(*result == -32);
std::print("{}", *result);
}
Yeah, considering I've written 2 scripting languages now, I'm actually really bad at parsing!
Example:
https://compiler-explorer.com/z/vjrhYn9Yx