parser: Note intent to switch to a Pratt parser

This commit is contained in:
John 2024-02-27 23:35:41 -06:00
parent ca51a35f5c
commit 67bb3d4ae3

View File

@ -337,7 +337,7 @@ const fn delim<'t, T>(
} }
/// Parses constructions of the form `(f sep ~until)*` /// Parses constructions of the form `(f sep ~until)*`
/// ///
/// where `~until` is a negative lookahead assertion /// where `~until` is a negative lookahead assertion
const fn sep<'t, T>( const fn sep<'t, T>(
f: impl Fn(&mut Parser<'t>) -> PResult<T>, f: impl Fn(&mut Parser<'t>) -> PResult<T>,
@ -359,7 +359,7 @@ const fn sep<'t, T>(
} }
/// Parses constructions of the form `(f ~until)*` /// Parses constructions of the form `(f ~until)*`
/// ///
/// where `~until` is a negative lookahead assertion /// where `~until` is a negative lookahead assertion
#[allow(dead_code)] #[allow(dead_code)]
const fn rep<'t, T>( const fn rep<'t, T>(
@ -897,6 +897,7 @@ impl<'t> Parser<'t> {
}; };
Ok(Assign { head, op, tail: self.expr_from(Self::exprkind_assign)?.into() }.into()) Ok(Assign { head, op, tail: self.expr_from(Self::exprkind_assign)?.into() }.into())
} }
// TODO: use a pratt parser for binary expressions, to simplify this
binary! { binary! {
exprkind_compare {exprkind_range, compare_op} exprkind_compare {exprkind_range, compare_op}
exprkind_range {exprkind_logic, range_op} exprkind_range {exprkind_logic, range_op}