Fix Stream::from_iter call

This commit is contained in:
Scott Richmond 2024-10-31 15:38:55 -04:00
parent 01a052f37a
commit 1b9f1d56bc

View File

@ -11,7 +11,7 @@
// todo: // todo:
// * [ ] rewrite fn parser to use chumsky::Recursive::declare/define // * [ ] rewrite fn parser to use chumsky::Recursive::declare/define
// - [ ] do this to extract/simplify/DRY things like tuple patterns, fn clauses, etc. // - [ ] do this to extract/simplify/DRY things like tuple patterns, fn clauses, etc.
// * [ ] Work around chumsky::Stream::from_iter().spanned disappearing in most recent version // * [x] Work around chumsky::Stream::from_iter().spanned disappearing in most recent version
// * [x] investigate using labels (which is behind a compiler flag, somehow) // * [x] investigate using labels (which is behind a compiler flag, somehow)
// * [ ] wire up Ariadne parsing errors // * [ ] wire up Ariadne parsing errors
// * [ ] validation // * [ ] validation
@ -764,7 +764,7 @@ pub fn main() {
println!("{}", token) println!("{}", token)
} }
let (ast, _) = parser() let (ast, _) = parser()
.parse(Stream::from_iter(to_parse).spanned(SimpleSpan::new(0, src.len()))) .parse(Stream::from_iter(to_parse).map((0..src.len()).into(), |(t, s)| (t, s)))
.unwrap(); .unwrap();
println!("{}", ast); println!("{}", ast);
} }