-
-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
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:
a/b/c
/a/b/c
a//c
/a//c
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('/')).stringbut 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?
Metadata
Metadata
Assignees
Labels
No labels