Merge pull request #20885 from ziglang/simplify-tokenizer

std.zig.tokenizer: simplification and spec conformance
This commit is contained in:
Andrew Kelley
2024-07-31 19:52:34 -07:00
committed by GitHub
19 changed files with 433 additions and 544 deletions

View File

@@ -133,20 +133,20 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
cases.add("scoped typedef",
\\void foo() {
\\ typedef union {
\\ int A;
\\ int B;
\\ int C;
\\ } Foo;
\\ Foo a = {0};
\\ {
\\ typedef union {
\\ int A;
\\ int B;
\\ int C;
\\ } Foo;
\\ Foo a = {0};
\\ }
\\ typedef union {
\\ int A;
\\ int B;
\\ int C;
\\ } Foo;
\\ Foo a = {0};
\\ {
\\ typedef union {
\\ int A;
\\ int B;
\\ int C;
\\ } Foo;
\\ Foo a = {0};
\\ }
\\}
, &[_][]const u8{
\\pub export fn foo() void {
@@ -2004,18 +2004,18 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
\\ break;
\\ }
\\ case 4:
\\ case 5:
\\ case 5:
\\ res = 69;
\\ {
\\ res = 5;
\\ return;
\\ return;
\\ }
\\ case 6:
\\ switch (res) {
\\ case 9: break;
\\ }
\\ res = 1;
\\ return;
\\ return;
\\ }
\\}
, &[_][]const u8{