aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-07-01 00:14:58 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-07-02 13:27:35 -0700
commit24c432608f6b07020fa0b18fc9c868ad6abd9b15 (patch)
treef9650d8c9aa36d6fddd45b1f70847304da16c0f5 /src/stage1/codegen.cpp
parent3f680abbe2c4d2eeefd0eb73b8af25d1768e6ceb (diff)
downloadzig-24c432608f6b07020fa0b18fc9c868ad6abd9b15.tar.gz
zig-24c432608f6b07020fa0b18fc9c868ad6abd9b15.zip
stage2: improve compile errors from tokenizer
In order to not regress the quality of compile errors, some improvements had to be made. * std.zig.parseCharLiteral is improved to return more detailed parse failure information. * tokenizer is improved to handle null bytes in the middle of strings, character literals, and line comments. * validating how many unicode escape digits in string literals is moved to std.zig.parseStringLiteral rather than handled in the tokenizer. * when a tokenizer error occurs, if the reported token is the 'invalid' tag, an error note is added to point to the invalid byte location. Further improvements would be: - Mention the expected set of allowed bytes at this location. - Display the invalid byte (if printable, print it, otherwise escape-print it).
Diffstat (limited to 'src/stage1/codegen.cpp')
0 files changed, 0 insertions, 0 deletions