Code Monkey home page Code Monkey logo

Comments (3)

zesterer avatar zesterer commented on June 12, 2024

Check out the map_span method if you want to change the span of input types, it should do what you want.

As an additional point, although Stream in 1.0.0 is somewhat akin to the same type in 0.9, chumsky is now a lot more general and can handle a far wider variety of input types. You might find that another type, like &str or &[T], does a better job for you than Stream. Additionally, inputs can now be nested (i.e: token trees).

For example, you can use &[MyToken] as an input type to your parser just fine, or SpannedInput<&[(MyToken, MySpan)]> to use your own span type too. Check out this example that demonstrates this.

from chumsky.

jackdotink avatar jackdotink commented on June 12, 2024

Ah I see, I didn't realize that Input was implemented for &[T]. I can definitely use that, thank you.

from chumsky.

zesterer avatar zesterer commented on June 12, 2024

You might find this section in the guide useful.

from chumsky.

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.