We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As we discovered on Zymposium on 22th of April, this example:
import zio.Chunk import zio.parser._ import zio.parser.internal.Debug object Example extends App { case class ChessCoord(row: Char, col: Byte) case class ChessMove(from: ChessCoord, to: ChessCoord) val chessCoord = (Syntax.charIn("ABCDEFGH") ~ Syntax.digit.transform( _.toString.toByte, (byte: Byte) => byte.toString.head )).transform( { case (r, c) => ChessCoord(r, c) }, (cc: ChessCoord) => (cc.row, cc.col) ) val whitespaces = Syntax.whitespace.repeat.unit(Chunk(' ')) val chessMove = (chessCoord ~ whitespaces ~ Syntax.string("->", ()) ~ whitespaces ~ chessCoord).transform( { case (from ,to) => ChessMove(from, to) }, (cm: ChessMove) => (cm.from, cm.to) ) Debug.printParserTree(chessMove.asParser.optimized) val parsed = chessMove.parseString("""E1 -> A4""") val printed = chessMove.printString(parsed.toOption.get) println(parsed) println(printed) }
runs very slowly.
The text was updated successfully, but these errors were encountered:
Fix slow parsing zio#67
45f42cb
Merge pull request #68 from vigoo/fix-67
ac500d3
Fix slow parsing #67
Successfully merging a pull request may close this issue.
As we discovered on Zymposium on 22th of April, this example:
runs very slowly.
The text was updated successfully, but these errors were encountered: