elm-format gives syntax problem whilst elm-make doesn't

Created on 21 May 2016  Â·  6Comments  Â·  Source: avh4/elm-format

My elm-format fails on main.elm with the following error

ERRORS
-- SYNTAX PROBLEM ------------------------------------------------- src/main.elm

I ran into something unexpected when parsing your code!

91│         Keyboard Maybe.Nothing -> (model, Cmd.none)
            ^
I am looking for one of the following things:

    end of input
    whitespace

But the program compiles and runs fine.

I have fiddled around with the data, but am unable to see how I can make a simple reproduceable example so I have just linked to the exact line that's throwing it in my commit.

https://github.com/mordrax/cotwelm/commit/061c65f37e30f5414809fa00cbfd44567fababd1#diff-fe0712052e5a2ffc39da25a010c18097R89

If I remove the messages in question, the file formats, but then it throws an error saying those cases are not met. I can do _ -> (model, Cmd.none) instead of the two Keyboard ... cases and that will also cause elm-format to work.

bug

All 6 comments

Are you using Elm 0.17? This could a problem with the Maybe.Nothing, which hit a parser bug on Elm 0.16.

okay, yes, the workaround is to put parens around Maybe.Nothing. But I will fix the elm-format parser to deal with this in 0.3.2-alpha.

Also, the error message the parser provides here is pretty misleading.

Fixed in 5e24aad...b3089c5

Thanks for the report!

Oh! I just realized what your project is. I loved Castle of the Winds :D

yes! thank you for the quick fix, i didn't expect that and also I expected even less that you know and loved the game. This gives me !--==## ENERGY ##==--! yeah!

0.4.0-alpha is now released with this fix https://github.com/avh4/elm-format#installation-

Was this page helpful?
0 / 5 - 0 ratings

Related issues

welblaud picture welblaud  Â·  3Comments

ahstro picture ahstro  Â·  4Comments

avh4 picture avh4  Â·  4Comments

ahstro picture ahstro  Â·  3Comments

avh4 picture avh4  Â·  6Comments