| author | |
| committer | |
| log | e063854563eac4ece0402320492657807571c5df |
| tree | ad7394bd68895ca3f6a9695ce29f78f7cb3d3e8e |
| parent | 8088bdc6d5d751766b4b4df700b864b5a0397eb6 |
| signature | Commit is signed but in an unrecognized format. |
2 files changed, 10 insertions(+), 1 deletions(-)
src-self-hosted/translate_c.zig+1-1| ... | ... | @@ -4874,7 +4874,7 @@ fn transPreprocessorEntities(c: *Context, unit: *ZigClangASTUnit) Error!void { |
| 4874 | 4874 | |
| 4875 | 4875 | var tok_it = tok_list.iterator(0); |
| 4876 | 4876 | const first_tok = tok_it.next().?; |
| 4877 | assert(first_tok.id == .Identifier and mem.eql(u8, slice[first_tok.start..first_tok.end], name)); | |
| 4877 | assert(mem.eql(u8, slice[first_tok.start..first_tok.end], name)); | |
| 4878 | 4878 | |
| 4879 | 4879 | var macro_fn = false; |
| 4880 | 4880 | const next = tok_it.peek().?; |
test/translate_c.zig+9| ... | ... | @@ -25,6 +25,15 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 25 | 25 | \\} |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | cases.add("macro keyword define", | |
| 29 | \\#define foo 1 | |
| 30 | \\#define inline 2 | |
| 31 | , &[_][]const u8{ | |
| 32 | \\pub const foo = 1; | |
| 33 | , | |
| 34 | \\pub const @"inline" = 2; | |
| 35 | }); | |
| 36 | ||
| 28 | 37 | cases.add("macro line continuation", |
| 29 | 38 | \\#define FOO -\ |
| 30 | 39 | \\BAR |