Remix.run Logo
tgv 20 hours ago

I don't really agree. Many top-down parsers find an error at an unexpected token. That token is often not the error. Quite often something is missing at that point, or there has been a mistake some way back. Translating e.g. "unexpected semicolon" into "keyword 'if' should be the identifier 'f'" is not easy.

spockz 20 hours ago | parent [-]

I think it becomes easier if you have some oracle, like a compiler, available to check whether the end result (after introducing suggestions) is viable.

I say it like this because to me the only valid way to come to the latter class of error messages (containing constructive suggestions) is by first coming up with possible edits and then checking whether they make the whole parse and compile.