gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

Bad error message when block is enclosed in parenthesis #305

Open apblack opened 4 years ago

apblack commented 4 years ago

I accidentally used parenthesis instead of braces to enclose a block that has an argument. I get this message

ast.grace[4005:25-30]: Syntax error: an argument list beginning with a '(' must end with a ')'.
4004:     method newVisitImplicit(aNode) -> Done {
4005:         aNode.childrenDo(each -> each.newAccept(self))
------------------------------^^^^^^

The message is not much help because there is indeed a closing ). I believe that the parser sees the ->, notices that it's not a comma or a closing paren, and complains. This case is probably worth a custom error message.