Git Product home page Git Product logo

Comments (6)

tungd avatar tungd commented on July 18, 2024

Hi, just wonder if there is anyone working on this? I've just finished one project using Parsy and willing to contribute.

from parsy.

spookylukey avatar spookylukey commented on July 18, 2024

I'm not working on this, contributions would be welcome. notFollowedBy is already implemented in the form of should_fail.

from parsy.

lisael avatar lisael commented on July 18, 2024

I've just sent a PR implementing the lookAhead #29

from parsy.

lisael avatar lisael commented on July 18, 2024

And here's a proposal for manyTill : #31

from parsy.

lisael avatar lisael commented on July 18, 2024

I've got a concern about my implementation of lookAhead. peek is a function rather than a method on Parser. It's something I find confusing when I'm working with Parsy: Is stuff a method or a function that takes a parser?

I did make a function, because it's how I implemented this as a helper function in a project of mine, no other reason.

Is there a rule of thumb for this dilemma, method or function?

Note that peek(p) is the exact equivalent of p.should_fail().should_fail() (and we should benchmark this to decide wich implementation is better). Maybe it makes sense to make it a method on Parser.

Same question for #31.

from parsy.

spookylukey avatar spookylukey commented on July 18, 2024

@lisael - yes, it is a bit hard to decide in some cases.

I think many_until makes more sense as a method, because it is similar to other things like many, and peek for a similar argument comparing to should_fail. I guess it's about a consistent fluent API.

For things that don't take a parser as an argument, or can take more than one, we use functions. I think that's a good rule of thumb.

from parsy.

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.