mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Support when
after binop
This commit is contained in:
parent
bbf867c1d1
commit
a1a3eff278
1 changed files with 8 additions and 2 deletions
|
@ -189,7 +189,7 @@ fn record_field_access<'a>() -> impl Parser<'a, &'a str, EExpr<'a>> {
|
|||
|
||||
/// In some contexts we want to parse the `_` as an expression, so it can then be turned into a
|
||||
/// pattern later
|
||||
fn parse_loc_term_or_underscore_or_if<'a>(
|
||||
fn parse_loc_term_or_underscore_or_conditional<'a>(
|
||||
min_indent: u32,
|
||||
options: ExprParseOptions,
|
||||
arena: &'a Bump,
|
||||
|
@ -198,6 +198,10 @@ fn parse_loc_term_or_underscore_or_if<'a>(
|
|||
one_of!(
|
||||
loc_expr_in_parens_etc_help(min_indent),
|
||||
loc!(specialize(EExpr::If, if_expr_help(min_indent, options))),
|
||||
loc!(specialize(
|
||||
EExpr::When,
|
||||
when::expr_help(min_indent, options)
|
||||
)),
|
||||
loc!(specialize(EExpr::Str, string_literal_help())),
|
||||
loc!(specialize(EExpr::SingleQuote, single_quote_literal_help())),
|
||||
loc!(specialize(EExpr::Number, positive_number_literal_help())),
|
||||
|
@ -304,7 +308,9 @@ fn loc_possibly_negative_or_negated_term<'a>(
|
|||
Expr::UnaryOp(arena.alloc(loc_expr), Loc::at(loc_op.region, UnaryOp::Not))
|
||||
}
|
||||
)),
|
||||
|arena, state| { parse_loc_term_or_underscore_or_if(min_indent, options, arena, state) }
|
||||
|arena, state| {
|
||||
parse_loc_term_or_underscore_or_conditional(min_indent, options, arena, state)
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue