commit 52b3daa90ee41ba7e059331cf7541eb8570ec236 (tree)
parent 9de2c1b76e2b38e35bb17cd0a3943a61c730da76
Author: Andrew Kelley <andrew@ziglang.org>
Date: Fri, 28 May 2021 14:19:08 -0700
stage1: get test-compile-errors passing again
Diffstat:
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/stage1/tokenizer.cpp b/src/stage1/tokenizer.cpp
@@ -747,6 +747,9 @@ void tokenize(const char *source, Tokenization *out) {
case 'u':
t.state = TokenizeState_char_literal_unicode_escape_saw_u;
break;
+ case 'U':
+ invalid_char_error(&t, c);
+ break;
default:
t.state = TokenizeState_char_literal_end;
break;
@@ -785,7 +788,7 @@ void tokenize(const char *source, Tokenization *out) {
break;
case '}':
if (seen_escape_digits == 0) {
- tokenize_error(&t, "missing unicode escape sequence");
+ tokenize_error(&t, "empty unicode escape sequence");
break;
}
t.state = TokenizeState_char_literal_end;
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
@@ -34,9 +34,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\ const c: *S = &.{};
\\}
, &[_][]const u8{
- "mp.zig:2:31: error: expected type '[][]const u8', found '*const struct:2:31'",
- "mp.zig:5:33: error: expected type '*[2][]const u8', found '*const struct:5:33'",
- "mp.zig:9:21: error: expected type '*S', found '*const struct:9:21'",
+ "tmp.zig:2:31: error: expected type '[][]const u8', found '*const struct:2:31'",
+ "tmp.zig:5:33: error: expected type '*[2][]const u8', found '*const struct:5:33'",
+ "tmp.zig:9:21: error: expected type '*S', found '*const struct:9:21'",
});
cases.add("@Type() union payload is undefined",
@@ -8416,6 +8416,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\ var sequence = "repeat".*** 10;
\\}
, &[_][]const u8{
- "tmp.zig:2:30: error: `.*` can't be followed by `*`. Are you missing a space?",
+ "tmp.zig:2:30: error: `.*` cannot be followed by `*`. Are you missing a space?",
});
}