desugar suffixed If-Then-Else expression

This commit is contained in:
Luke Boswell 2024-04-03 19:35:56 +11:00
parent d08a51b134
commit b010e8caba
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
2 changed files with 147 additions and 6 deletions

View file

@ -374,6 +374,13 @@ pub fn is_loc_expr_suffixed(loc_expr: &Loc<Expr>) -> bool {
}
}
pub fn split_around<'a, T>(items: &'a [T], target: usize) -> (&'a [T], &'a [T]) {
let (before, rest) = items.split_at(target);
let after = &rest[1..];
(before, after)
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct PrecedenceConflict<'a> {
pub whole_region: Region,