use itertools::Itertools; use pest::prec_climber as pcl; use pest::prec_climber::PrecClimber; use std::rc::Rc; use pest_consume::{match_nodes, Parser}; use crate::map::{DupTreeMap, DupTreeSet}; use crate::ExprF::*; use crate::*; // This file consumes the parse tree generated by pest and turns it into // our own AST. All those custom macros should eventually moved into // their own crate because they are quite general and useful. For now they // are here and hopefully you can figure out how they work. type ParsedText = InterpolatedText>; type ParsedTextContents = InterpolatedTextContents>; type ParseInput<'input> = pest_consume::Node<'input, Rule, Rc>; pub type ParseError = pest::error::Error; pub type ParseResult = Result; #[derive(Debug)] enum Selector { Field(Label), Projection(DupTreeSet