Comments (3)
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.
Ah I see, I didn't realize that Input
was implemented for &[T]
. I can definitely use that, thank you.
from chumsky.
You might find this section in the guide useful.
from chumsky.
Related Issues (20)
- `/examples/foo.rs` is different from the tutorial HOT 1
- stack overflow HOT 3
- Ability to create warnings HOT 2
- `vars` gets not correctly truncated in example code HOT 1
- error: "unknown feature stdsimd" cause by the dependency of ahash when update rustc to 1.78.0-nightly HOT 2
- Cannot ignore whitespace without changing the width of the span HOT 3
- `skip_until` is consuming the `until` HOT 6
- Strange padding issue? HOT 1
- WebAssembly build error HOT 6
- MapExtra cannot infer state type HOT 1
- How to debug and see the parsing process trace of chumsky combinators. HOT 2
- Combine `then` and `or_not` preventing extraneous backtracking HOT 1
- Labels don't show unless the EOI is in it's place HOT 2
- no method named `to_slice` found for opaque type `impl Parser<_, <_ as Character>::Collection, Error = _> + Copy + Clone` in the current scope HOT 3
- In big sequences of just's separated by or's, is it preferred to map the ouput every time or match at the end? HOT 2
- I'm upgrading to 1.0.0-alpha.7 I can't get the parser function signature right HOT 1
- docs.rs links to GH files appear broken HOT 1
- Stack overflow caused by defining an unused parser HOT 2
- Add a `spanned` method for automatically wrapping the parser result in a `Span`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chumsky.