Skip to content

Lexer: Provide more helpful error message for trailing colon #1828

@joliss

Description

@joliss

If you accidentally add a colon at the end of a line, like in Python, the CoffeeScript compiler (HEAD) produces rather unhelpful error messages. I ended up spending some time yesterday hunting down an extra colon in the middle of my source. ;-)

$ bin/coffee -sc
while 1:
  1
Error: Parse error on line 2: Unexpected 'TERMINATOR'

$ bin/coffee -sc
for i in [1]:
  1
Error: Parse error on line 1: Unexpected '{'

This is not really a bug, more like a nuisance -- just thought you might appreciate the report. Feel free to close it if there is nothing that can be done.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions