elm-lang / elm-reactor

Interactive development tool that makes it easy to develop and debug Elm programs.
BSD 3-Clause "New" or "Revised" License
428 stars 63 forks source link

Unicode BOM in source file causes compilation error #210

Open ncote opened 8 years ago

ncote commented 8 years ago

Files with UTF-8 encoding with the Unicode BOM (byte order mark) at the start don't compile, and the error is particularly cryptic in elm-reactor, since the error pointer points to a line that looks valid, since the BOM is not visible. On the command line (elm-make) with a non unicode terminal, 3 garbage characters appear, which might make this a bit more obvious.

Elm Platform 0.17.0 on Windows 7.

Here's an example from elm-reactor:

Detected errors in 1 module.

-- SYNTAX PROBLEM ---------------------------------------------------- Hello.elm

I ran into something unexpected when parsing your code!

1| import Html exposing (div, button, text)
   ^

And on my badly-configured terminal:

-- SYNTAX PROBLEM ---------------------------------------------------- Hello.elm

I ran into something unexpected when parsing your code!

1| import Html exposing (div, button, text)
process-bot commented 8 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.