Skip to content

Commit

Permalink
Do not require parens for trailing fun.
Browse files Browse the repository at this point in the history
  • Loading branch information
gebner committed Aug 15, 2024
1 parent d33938a commit 375e6fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocaml/fstar-lib/FStar_Parser_Parse.mly
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,6 @@ conjunctivePat:

simpleTerm:
| e=tmIff { e }
| FUN pats=nonempty_list(patternOrMultibinder) RARROW e=term
{ mk_term (Abs(flatten pats, e)) (rr2 $loc($1) $loc(e)) Un }

maybeFocusArrow:
| RARROW { false }
Expand Down Expand Up @@ -1420,6 +1418,8 @@ atomicTerm:
{ x }
| x=opPrefixTerm(atomicTermQUident)
{ x }
| FUN pats=nonempty_list(patternOrMultibinder) RARROW e=term
{ mk_term (Abs(flatten pats, e)) (rr2 $loc($1) $loc(e)) Un }

atomicTermQUident:
| id=quident
Expand Down
12 changes: 12 additions & 0 deletions tests/bug-reports/Parentheses.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Parentheses

let forall_intro #t (#p: t->Type0) (h: (x:t -> squash (p x))) : squash (forall x. p x) =
Classical.Sugar.forall_intro _ _ h

let trailing_fun_does_not_require_parens :
squash (forall (x: nat) (y: nat). x + y >= 0) =
forall_intro fun x -> forall_intro fun y -> ()

let trailing_fun_swallows_seqs :
squash (forall (x: nat) (y: nat). x + y >= 0) =
forall_intro fun x -> forall_intro fun y -> (); ()

0 comments on commit 375e6fd

Please sign in to comment.