Validate literals at a later stage #12449
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
error message
This issue points out an error message that is unhelpful and should be improved.
frontend
Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone
Most people would recognize
0x213g
as a malformed hex literal and the same goes for''
being an empty char literal but currently Zig validates these kinds of error in the tokenizer, giving out terrible, vague errors likeexpected expression, found 'invalid bytes'
and preventing formatting.It would instead be better to have the tokenizer only validate things that actually prevent the tokens from being valid such as newlines in string literals (which should also give a proper error message instead of the same
invalid bytes
one) and leave everything else to AstGen.The text was updated successfully, but these errors were encountered: