authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-28 14:19:08-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-28 14:19:08-07:00
log52b3daa90ee41ba7e059331cf7541eb8570ec236
treefd92ea0a7fc3b7a15f1d22f74ff3facb38d5d1d7
parent9de2c1b76e2b38e35bb17cd0a3943a61c730da76

stage1: get test-compile-errors passing again


2 files changed, 8 insertions(+), 5 deletions(-)

src/stage1/tokenizer.cpp+4-1
......@@ -747,6 +747,9 @@ void tokenize(const char *source, Tokenization *out) {
747747 case 'u':
748748 t.state = TokenizeState_char_literal_unicode_escape_saw_u;
749749 break;
750 case 'U':
751 invalid_char_error(&t, c);
752 break;
750753 default:
751754 t.state = TokenizeState_char_literal_end;
752755 break;
......@@ -785,7 +788,7 @@ void tokenize(const char *source, Tokenization *out) {
785788 break;
786789 case '}':
787790 if (seen_escape_digits == 0) {
788 tokenize_error(&t, "missing unicode escape sequence");
791 tokenize_error(&t, "empty unicode escape sequence");
789792 break;
790793 }
791794 t.state = TokenizeState_char_literal_end;
test/compile_errors.zig+4-4
......@@ -34,9 +34,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3434 \\ const c: *S = &.{};
3535 \\}
3636 , &[_][]const u8{
37 "mp.zig:2:31: error: expected type '[][]const u8', found '*const struct:2:31'",
38 "mp.zig:5:33: error: expected type '*[2][]const u8', found '*const struct:5:33'",
39 "mp.zig:9:21: error: expected type '*S', found '*const struct:9:21'",
37 "tmp.zig:2:31: error: expected type '[][]const u8', found '*const struct:2:31'",
38 "tmp.zig:5:33: error: expected type '*[2][]const u8', found '*const struct:5:33'",
39 "tmp.zig:9:21: error: expected type '*S', found '*const struct:9:21'",
4040 });
4141
4242 cases.add("@Type() union payload is undefined",
......@@ -8416,6 +8416,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
84168416 \\ var sequence = "repeat".*** 10;
84178417 \\}
84188418 , &[_][]const u8{
8419 "tmp.zig:2:30: error: `.*` can't be followed by `*`. Are you missing a space?",
8419 "tmp.zig:2:30: error: `.*` cannot be followed by `*`. Are you missing a space?",
84208420 });
84218421}