Something went wrong. Try again.
Actually just three programming languages in a trenchcoat
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132use super::{query::Precedence, *};use crate::{Parser, Spanned};use source_span::Span;use trilogy_scanner::{Token, TokenType::*};
#[derive(Clone, Debug, PrettyPrintSExpr)]pub struct QueryConjunction { pub lhs: Query, pub and: Token, pub rhs: Query, span: Span,}
impl Spanned for QueryConjunction { fn span(&self) -> Span { self.span }}
impl QueryConjunction { pub(crate) fn parse(parser: &mut Parser, lhs: Query) -> SyntaxResult<Self> { let and = parser.expect(KwAnd).unwrap(); let rhs = Query::parse_precedence(parser, Precedence::Conjunction)?; Ok(Self { span: lhs.span().union(rhs.span()), lhs, and, rhs, }) }}