GithubHelp home page GithubHelp logo

Comments (3)

nblumhardt avatar nblumhardt commented on July 18, 2024

Thanks for the report, @SeeDee82 - this is indeed a bug. I've created #78 to fix, including your test case.

I'll merge it through to dev so that a pre-release package is published; it would be fantastic if you can check that the new package behaves as you expect.

Thanks again!

from superpower.

SeeDee82 avatar SeeDee82 commented on July 18, 2024

Thank you for the fast fix, this looks good.

On the subject of backtracking, can you explain why you decided to have backtracking only as opt-in. It seems to me that you would always want to have backtracking on by default.
The only two places I could find where backtracking is used at all are the Many and Or combinators, and in both cases I think you would expect partial failure and need the ability to try the next parser regardless of the reason for or the internal state after the failure.

from superpower.

nblumhardt avatar nblumhardt commented on July 18, 2024

👍

Sprache (the inspiration for Superpower) does backtrack by default; in that approach you need to opt out of backtracking in order to improve error messages, rather than opt-in to make the parser work. Tests usually cover having the parser work, so optimizing for good error reporting by default means that the harder-to-test part (the error messages for scenarios the parser author might not have considered) is generally okay. HTH!

from superpower.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.