Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upParser bug with record assignment #33
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Dec 7, 2014
Member
Please open this on the elm-compiler repo. I know about this, but have never gotten around to fixing it because it is trickier than it sounds. Currently, "whitespace" means "a bunch of spacey things that do not end with a newline" so things need to be a bit tricky to make this work given how the parser is set up.
Definitely deserves an issue though!
|
Please open this on the elm-compiler repo. I know about this, but have never gotten around to fixing it because it is trickier than it sounds. Currently, "whitespace" means "a bunch of spacey things that do not end with a newline" so things need to be a bit tricky to make this work given how the parser is set up. Definitely deserves an issue though! |
evancz
closed this
Dec 7, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Whoops! Created elm/compiler#842 instead. |
rtfeldman commentedDec 7, 2014
Take a look at https://github.com/rtfeldman/dreamwriter/blob/75651371541a88a1d85504e70c7e41afd914eaae/Dreamwriter/Model.elm
Notice that
emptyStateat the bottom awkwardly has an extra level of indentation compared to thetype aliasabove. It turns out this extra indentation is currently mandatory for record assignment.If you attempt to do the "commas at the end of the line" style like this, the parser will let you do indentation "normally" in the case of
type alias(as you can see earlier in the file), but if you try to use this style with record assignment (as withemptyState) and use "normal" indentation instead of awkward extra indentation, you get the following syntax error: