treat byte order mark as zero-width whitespace
The U+FEFF ZERO WIDTH NO-BREAK SPACE Unicode character, better known as BYTE ORDER MARK (BOM), currently gives a lexical error:
$ printf '\xEF\xBB\xBF\nz = "str"\n' > z.hs
$ ghci z.hs
GHCi, version 6.8.0.20070927: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
z.hs:1:0: lexical error at character '\65279'
Failed, modules loaded: none.
Prelude> Leaving GHCi.
The character is only in categories Other and Format, not Space, but I think we should lex it as whitespace anyway (with zero width for the purposes of the layout rule). Ideally Haskell' would do likewise.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.8 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Unknown |
| Architecture | Unknown |