extra semi-colons

Dear Cafe, why does ghc accept the extra semi-colon in case () of { () -> (); } or even case () of { ;;; () -> () ;;; } Yes I understand that semicolons like this are introduce by the layout rule L (<n> : ts) (m : ms) = ; : (L ts (m : ms)) if m = n https://www.haskell.org/onlinereport/haskell2010/haskellch10.html#x17-178000... and it's convenient to ignore extra ones. But it's not in the grammar? alts → alt1 ; … ; altn (n ≥ 1) https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-460003.1... - J.

On Tue, Jun 25, 2019 at 12:43:03PM +0200, Johannes Waldmann wrote:
But it's not in the grammar?
alts → alt1 ; … ; altn (n ≥ 1)
https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-460003.1...
The rule "alt" allows "(empty alternative)"
participants (2)
-
Johannes Waldmann
-
Tom Ellis