Closed homersimpsons closed 6 months ago
The final string is created by number.collect()
, so results of internal parts of number are irrelevant.
Oh okay, so the goal of all the parsers here is just to match a number-like sequence. Then the whole matched byte sequence is converted.
Thank you for your explanation! I could not wrap my head around this...
(I do not know where to ask for this question)
In the README there is an example for a JSON parser. I do not really uderstand how this line works:
Especially about the
-
inone_of(b"123456789") - one_of(b"0123456789").repeat(0..)
.Reading the documentation above I see:
So here I would expect the
integer
to be only the first char, for instance given1234
, integer would be only1
.Technically I would have expected a
+
here, because the documentation says:But using a
+
gives a compilation error (even with parentheses).How does that work with a
-
here ?