mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Remove backpassing
This commit is contained in:
parent
b8040bf6a2
commit
cbcbfd3265
94 changed files with 231 additions and 2246 deletions
|
@ -535,8 +535,6 @@ pub enum Expr<'a> {
|
|||
/// Multiple defs in a row
|
||||
Defs(&'a Defs<'a>, &'a Loc<Expr<'a>>),
|
||||
|
||||
Backpassing(&'a [Loc<Pattern<'a>>], &'a Loc<Expr<'a>>, &'a Loc<Expr<'a>>),
|
||||
|
||||
Dbg,
|
||||
DbgStmt {
|
||||
first: &'a Loc<Expr<'a>>,
|
||||
|
@ -722,7 +720,6 @@ pub fn is_expr_suffixed(expr: &Expr) -> bool {
|
|||
Expr::Crash => false,
|
||||
Expr::Tag(_) => false,
|
||||
Expr::OpaqueRef(_) => false,
|
||||
Expr::Backpassing(_, _, _) => false, // TODO: we might want to check this?
|
||||
Expr::Dbg => false,
|
||||
Expr::DbgStmt {
|
||||
first,
|
||||
|
@ -987,11 +984,6 @@ impl<'a, 'b> RecursiveValueDefIter<'a, 'b> {
|
|||
push_stack_from_record_fields!(fields);
|
||||
}
|
||||
Closure(_, body) => expr_stack.push(&body.value),
|
||||
Backpassing(_, a, b) => {
|
||||
expr_stack.reserve(2);
|
||||
expr_stack.push(&a.value);
|
||||
expr_stack.push(&b.value);
|
||||
}
|
||||
DbgStmt {
|
||||
first,
|
||||
extra_args,
|
||||
|
@ -2575,7 +2567,6 @@ impl<'a> Malformed for Expr<'a> {
|
|||
|
||||
Closure(args, body) => args.iter().any(|arg| arg.is_malformed()) || body.is_malformed(),
|
||||
Defs(defs, body) => defs.is_malformed() || body.is_malformed(),
|
||||
Backpassing(args, call, body) => args.iter().any(|arg| arg.is_malformed()) || call.is_malformed() || body.is_malformed(),
|
||||
Dbg => false,
|
||||
DbgStmt { first, extra_args, continuation } => first.is_malformed() || extra_args.iter().any(|a| a.is_malformed()) || continuation.is_malformed(),
|
||||
LowLevelDbg(_, condition, continuation) => condition.is_malformed() || continuation.is_malformed(),
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -59,7 +59,7 @@ pub enum Token {
|
|||
Paren,
|
||||
Arrow,
|
||||
Pipe,
|
||||
Backpass,
|
||||
BackArrow,
|
||||
Decimal,
|
||||
Multiply,
|
||||
Underscore,
|
||||
|
@ -257,7 +257,7 @@ fn highlight_inner<'a>(
|
|||
Token::LessThanEquals
|
||||
} else if state.bytes().first() == Some(&b'-') {
|
||||
state.advance_mut(1);
|
||||
Token::Backpass
|
||||
Token::BackArrow
|
||||
} else {
|
||||
Token::LessThan
|
||||
};
|
||||
|
@ -556,7 +556,7 @@ mod tests {
|
|||
),
|
||||
Loc::at(
|
||||
Region::between(Position::new(6), Position::new(8)),
|
||||
Token::Backpass,
|
||||
Token::BackArrow,
|
||||
),
|
||||
Loc::at(
|
||||
Region::between(Position::new(9), Position::new(11)),
|
||||
|
|
|
@ -716,11 +716,6 @@ impl<'a> Normalize<'a> for Expr<'a> {
|
|||
),
|
||||
Expr::Crash => Expr::Crash,
|
||||
Expr::Defs(a, b) => fold_defs(arena, a.defs(), b.value.normalize(arena)),
|
||||
Expr::Backpassing(a, b, c) => Expr::Backpassing(
|
||||
arena.alloc(a.normalize(arena)),
|
||||
arena.alloc(b.normalize(arena)),
|
||||
arena.alloc(c.normalize(arena)),
|
||||
),
|
||||
Expr::Dbg => Expr::Dbg,
|
||||
Expr::DbgStmt {
|
||||
first,
|
||||
|
@ -1083,9 +1078,6 @@ impl<'a> Normalize<'a> for EExpr<'a> {
|
|||
}
|
||||
EExpr::MalformedPattern(_pos) => EExpr::MalformedPattern(Position::zero()),
|
||||
EExpr::QualifiedTag(_pos) => EExpr::QualifiedTag(Position::zero()),
|
||||
EExpr::BackpassComma(_pos) => EExpr::BackpassComma(Position::zero()),
|
||||
EExpr::BackpassArrow(_pos) => EExpr::BackpassArrow(Position::zero()),
|
||||
EExpr::BackpassContinue(_pos) => EExpr::BackpassContinue(Position::zero()),
|
||||
EExpr::DbgContinue(_pos) => EExpr::DbgContinue(Position::zero()),
|
||||
EExpr::When(inner_err, _pos) => {
|
||||
EExpr::When(inner_err.normalize(arena), Position::zero())
|
||||
|
|
|
@ -519,9 +519,6 @@ pub enum EExpr<'a> {
|
|||
ElmStyleFunction(Region, Position),
|
||||
MalformedPattern(Position),
|
||||
QualifiedTag(Position),
|
||||
BackpassComma(Position),
|
||||
BackpassArrow(Position),
|
||||
BackpassContinue(Position),
|
||||
DbgContinue(Position),
|
||||
|
||||
When(EWhen<'a>, Position),
|
||||
|
@ -603,9 +600,6 @@ impl<'a> EExpr<'a> {
|
|||
| EExpr::ElmStyleFunction(_, p)
|
||||
| EExpr::MalformedPattern(p)
|
||||
| EExpr::QualifiedTag(p)
|
||||
| EExpr::BackpassComma(p)
|
||||
| EExpr::BackpassArrow(p)
|
||||
| EExpr::BackpassContinue(p)
|
||||
| EExpr::DbgContinue(p)
|
||||
| EExpr::Underscore(p)
|
||||
| EExpr::Crash(p)
|
||||
|
|
|
@ -548,8 +548,7 @@ fn record_pattern_field<'a>() -> impl Parser<'a, Loc<Pattern<'a>>, PRecord<'a>>
|
|||
))
|
||||
}
|
||||
Some(Second(_)) => {
|
||||
let val_parser =
|
||||
specialize_err_ref(PRecord::Expr, crate::expr::loc_expr(false, false));
|
||||
let val_parser = specialize_err_ref(PRecord::Expr, crate::expr::loc_expr(false));
|
||||
|
||||
let (_, loc_val, state) =
|
||||
spaces_before(val_parser).parse(arena, state, min_indent)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue