You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0599]: no method named `to_slice` found for opaque type `impl Parser<_, <_ as Character>::Collection, Error = _> + Copy + Clone` in the current scope
--> src/parser/spell.rs:18:6
|
17 | let zint = text::int(10)
| ______________-
18 | | .to_slice()
| | -^^^^^^^^ method not found in `impl Parser<_, <_ as Character>::Collection, Error = _> + Copy + Clone`
| |_____|
|
error[E0599]: no method named `to_slice` found for struct `Then` in the current scope
--> src/parser/spell.rs:25:6
|
23 | let float = text::int(10)
| _______________-
24 | | .then(just('.').then(text::digits(10)))
25 | | .to_slice()
| | -^^^^^^^^ method not found in `Then<impl Parser<char, ..., Error = ...> + Copy + Clone, ...>`
| |_____|
|
|
= note: the full type name has been written to '/Users/yonkeltron/.cargo/shared_target/debug/deps/splang-ebcbc78b3a0326cb.long-type-13662306929836172744.txt'
= note: consider using `--verbose` to print the full type name to the console
error[E0599]: no method named `to_slice` found for struct `Map` in the current scope
--> src/parser/spell.rs:33:6
|
30 | let string = just('"')
| ________________-
31 | | .ignore_then(none_of('"').repeated())
32 | | .then_ignore(just('"'))
33 | | .to_slice()
| | -^^^^^^^^ method not found in `Map<Then<Map<Then<Just<char, char, _>, ...>, ..., ...>, ...>, ..., ...>`
| |_____|
|
|
= note: the full type name has been written to '/Users/yonkeltron/.cargo/shared_target/debug/deps/splang-ebcbc78b3a0326cb.long-type-9340547084340958696.txt'
= note: consider using `--verbose` to print the full type name to the console
error[E0599]: no method named `to_slice` found for struct `Just` in the current scope
--> src/parser/spell.rs:36:30
|
36 | let manna_pos = just("+M").to_slice().map(LiteralValue::MannaPos);
| ^^^^^^^^ method not found in `Just<_, &str, _>`
error[E0599]: no method named `to_slice` found for struct `Just` in the current scope
--> src/parser/spell.rs:37:30
|
37 | let manna_neg = just("-M").to_slice().map(LiteralValue::MannaNeg);
| ^^^^^^^^ method not found in `Just<_, &str, _>`
Honestly, I'm not sure how to interpret the error considering that it's unclear if I am writing incorrect parsing logic, or just annotating type signatures incorrectly.
Here is some of my system info:
❯ rustc --version at 06:37:05
rustc 1.78.0 (9b00956e5 2024-04-29)
ats/splang on main [?] is 📦 v0.1.0 via 🦀 v1.78.0
❯ cargo --version at 06:41:57
cargo 1.78.0 (54d8815d0 2024-03-26)
ats/splang on main [?] is 📦 v0.1.0 via 🦀 v1.78.0
❯ cat Cargo.toml | grep chumsky at 06:42:00
chumsky = "0.9.3"
ats/splang on main [?] is 📦 v0.1.0 via 🦀 v1.78.0
❯ uname -a at 06:42:13
Darwin Qafih.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:19:22 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8112 arm64
Please let me know if I can provide additional information.
Thanks,
+Jonathan
The text was updated successfully, but these errors were encountered:
In 1.0, there have been a few changes. Firstly, a lifetime parameter has been added to Parser (the lifetime of the input being parsed).
Secondly, the first type parameter of Parser has changed from the 'token type' (i.e: char) to the underlying input type (in your case, &'a str) to allow for more complex manipulation of the underlying input, such as the ability to take slices of it (as you're doing!).
Lastly, we added a few extra type parameters to Parser (to support features like stateful parsing, context-sensitivity parsing, etc.). To make this a bit easier to handle, we squashed them all into a single type parameter which you can use like so:
Hello,
When attempting to compile the following code, I get a very confusing error.
The error I get is:
Honestly, I'm not sure how to interpret the error considering that it's unclear if I am writing incorrect parsing logic, or just annotating type signatures incorrectly.
Here is some of my system info:
Please let me know if I can provide additional information.
Thanks,
+Jonathan
The text was updated successfully, but these errors were encountered: