mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
fix problem with negation/subtraction
This commit is contained in:
parent
2def201a9a
commit
872f83680f
1 changed files with 2 additions and 1 deletions
|
@ -184,7 +184,8 @@ pub fn unary_op<'a>(min_indent: u16) -> impl Parser<'a, Expr<'a>> {
|
|||
),
|
||||
map_with_arena!(
|
||||
and!(
|
||||
loc!(ascii_char(b'-')),
|
||||
// must backtrack to distinguish `x - 1` from `-1`
|
||||
loc!(backtrackable(ascii_char(b'-'))),
|
||||
loc!(move |arena, state| parse_expr(min_indent, arena, state))
|
||||
),
|
||||
|arena: &'a Bump, (loc_op, loc_expr): (Located<()>, Located<Expr<'a>>)| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue