mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
desugar suffixed If-Then-Else expression
This commit is contained in:
parent
d08a51b134
commit
b010e8caba
2 changed files with 147 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue