Skip to content

Commit

Permalink
Allow era term to be surrounded by parens
Browse files Browse the repository at this point in the history
  • Loading branch information
imaqtkatt committed Aug 15, 2024
1 parent d6a1995 commit 101ea27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fun/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ impl<'a> TermParser<'a> {
return Ok(Term::Fan { fan: FanKind::Tup, tag: tag.unwrap_or(Tag::Static), els });
}

if self.try_consume(")") {
return Ok(Term::Era);
}

// Opr
unexpected_tag(self)?;
let fst = self.parse_term()?;
Expand Down
1 change: 1 addition & 0 deletions tests/golden_tests/parse_file/era.bend
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(Main) = (*)
5 changes: 5 additions & 0 deletions tests/snapshots/parse_file__era.bend.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
source: tests/golden_tests.rs
input_file: tests/golden_tests/parse_file/era.bend
---
(Main) = *

0 comments on commit 101ea27

Please sign in to comment.