Add new `...` ellipsis keyword
To support incomplete code, we want to add a new ... ellipsis keyword (not an operator, since it doesn't operate on anything, even though it's not a word). It will be a syntax node that takes no arguments and acts somewhat like crash "Not yet written". The difference being that:
- An ellipsis won't trigger "unreachable code" errors
- It is considered as a new type of code issue: a note, in addition to errors and warnings.
- For reporting notes, they should be highlighted as issues in code (but not doc code blocks), but only reported if there are no errors or warnings.
- Notes should return a non-zero exit code to imply that there is an issue.
- Notes should also be aggregated at the module level, something like:
── UNFINISHED CODE in path/To/Module.roc ───────────────────────────────────────
I still see a 3 places where code was left unfinished in this module:
35| if x == ... then
^^^
37| abc = ...
^^^
60| func.call("foo", ...)
^^^
────────────────────────────────────────────────────────────────────────────────
0 errors and 0 warnings found in XYZ ms.
A good way to implement this would probably be to desugar this to crash "Not yet written", but add a kind: CrashKind field on roc_can crash nodes to report compilation issues differently for ellipses and normal crashes.
For clarity for whoever implements this (as there isn't a linked a Zulip thread), this wouldn't be for type annotations, where the existing type hole (_) type would be used instead, right?
That's correct! This is just for arbitrary expressions in code and in doc code blocks.
We have only implemented the parsing of ellipses, their canonicalization and all is the remaining bulk of the work.