hylo-lang / hylo

The Hylo programming language

Home Page:https://www.hylo-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unterminated string/comment source locations seem a little strange

dabrahams opened this issue · comments

static func error(unterminatedCommentEndingAt endLocation: SourcePosition) -> Diagnostic {

Do we really ever want to report where an unterminated thing ends? Won't that always be the end of the file? Wouldn't it be more useful to point the user to where it began?

It looks like these failures mostly do get reported at the beginning and the labels/names are simply wrong.
The one exception that for some reason an unterminated outer comment gets reported at the beginning of the last terminated nested comment. The logic behind that is mysterious.