Closed evancz closed 5 years ago
The parser revamp for 0.19.1 seems to address the root problems here.
Rather than providing helpful links, I tried to add super specific information in the error messages themselves. This way (1) there are no links to follow, (2) the info does not need to be hosted somewhere, (3) it is versioned with the compiler if things change. I think this ends up being really nice for syntax in particular where one good example goes a long way!
I think the parse errors could be improved in two ways:
When the parser has totally failed, try to recognize some symbols and keywords. So if you see it failed on
as
#139 orport
#76 you can provide a hint about them not being variables. Or about->
showing up in definitions #142. This would also let you underline the whole token.Provide links to a syntax document based on context. This requires that a syntax document is created specially for this purpose, though it could double as relatively dry and verbose documentation.
Besides the issues already linked, the following issues could also benefit from this:
2 -
type Point = { x : Int, y : Int }
126 - type annotation then definition body, but forgot to start the definition
136 - missing
exposing
inmodule
declaration168 -
{ x = 3, , y = 4 }