Skip to content

Commit

Permalink
Replace CharPred.rep with CharsWhile
Browse files Browse the repository at this point in the history
  • Loading branch information
japgolly committed Dec 8, 2020
1 parent a02b33c commit 5753cf6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/tlaquery/Parsers.scala
Expand Up @@ -48,16 +48,16 @@ object Parsers {
}

def WS[_: P]: P[Unit] =
P(CharPred(isWhitespace).rep(1))
P(CharsWhile(isWhitespace, 1))

def OWS[_: P]: P[Unit] =
P(CharPred(isWhitespace).rep)
P(CharsWhile(isWhitespace, 0))

def EOL[_: P]: P[Unit] =
P("\n" | End)

def line[_: P]: P[String] =
P(!End ~ CharPred(_ != '\n').rep.! ~ EOL)
P(!End ~ CharsWhile(_ != '\n', 0).! ~ EOL)

def lineNE[_: P]: P[String] =
line.filter(_.nonEmpty)
Expand Down Expand Up @@ -87,7 +87,7 @@ object Parsers {
P("<Initial predicate>").map(_ => Desc.Initial)

def descAction[_: P]: P[Desc] =
P("<" ~ ident.! ~ " line " ~ CharPred(_ != '>').rep ~ ">").map(Desc.Action)
P("<" ~ ident.! ~ " line " ~ CharsWhile(_ != '>') ~ ">").map(Desc.Action)

def descStuttering[_: P]: P[Desc] =
P("Stuttering").map(_ => Desc.Stuttering)
Expand Down

0 comments on commit 5753cf6

Please sign in to comment.