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
Current import: "org.tpolecat" %% "atto-core" % "0.4.2"
"org.tpolecat" %% "atto-core" % "0.4.2"
Example code:
lazy val exprBad: Parser[Int] = eParensBad | eLiteralInt lazy val eParensBad: Parser[Int] = char('(') *> many(whitespace) *> exprBad <* many(whitespace) <* char(')') lazy val exprGood: Parser[Int] = eParensGood | eLiteralInt lazy val eParensGood: Parser[Int] = { for { _ <- char('(') _ <- many(whitespace) e <- exprGood _ <- many(whitespace) _ <- char(')') } yield (e) } lazy val eLiteralInt: Parser[Int] = int def makeItCrash = exprBad.parse("5").done def worksFine = exprGood.parse("5").done scala> worksFine res0: atto.ParseResult[Int] = Done(,5) scala> makeItCrash java.lang.StackOverflowError <stacktrace bouncing between exprBad and eParensBad>
The text was updated successfully, but these errors were encountered:
Note: Switching from *> to ~> also avoids the stack overflow.
Sorry, something went wrong.
No branches or pull requests
Current import:
"org.tpolecat" %% "atto-core" % "0.4.2"
Example code:
The text was updated successfully, but these errors were encountered: