Hi all,
I'm trying to port scala-uri to cats-parse.
One difficulty I'm facing is with parsing path parts including empty ones:
What I would like to do is something like this (simplified)
def _path_segment: Parser0[String] = Parser.until0(charIn("/?#"))
def _path: Parser[String] = (Parser.char('/').? ~ _path_segment.repSep0(char('/')).string
but this doesn't work, as Parser0 doesn't have repSep or repSep0 defined.
I understand that Parser0#rep is problematic, as one could easily run the empty parser infinitely, but in my naive thinking this problem shouldn't exist with repSep, right?
Or is there a nicer way to do this in cats-parse?
Hi all,
I'm trying to port scala-uri to cats-parse.
One difficulty I'm facing is with parsing path parts including empty ones:
What I would like to do is something like this (simplified)
but this doesn't work, as
Parser0doesn't haverepSeporrepSep0defined.I understand that
Parser0#repis problematic, as one could easily run the empty parser infinitely, but in my naive thinking this problem shouldn't exist withrepSep, right?Or is there a nicer way to do this in cats-parse?