| author | |
| committer | |
| log | b15958c557d3b29c8d4cee9951a8bfd30c215482 |
| tree | 403355064937bdbeee0951074d89468184946ef2 |
| parent | 9e1afdc23469e1dece4aea318eb8ad2f6c100a94 |
2 files changed, 9 insertions(+), 0 deletions(-)
lib/std/c/tokenizer.zig+2| ... | ... | @@ -616,6 +616,7 @@ pub const Tokenizer = struct { |
| 616 | 616 | }, |
| 617 | 617 | .BackSlash => switch (c) { |
| 618 | 618 | '\n' => { |
| 619 | result.start = self.index + 1; | |
| 619 | 620 | state = .Start; |
| 620 | 621 | }, |
| 621 | 622 | '\r' => { |
| ... | ... | @@ -631,6 +632,7 @@ pub const Tokenizer = struct { |
| 631 | 632 | }, |
| 632 | 633 | .BackSlashCr => switch (c) { |
| 633 | 634 | '\n' => { |
| 635 | result.start = self.index + 1; | |
| 634 | 636 | state = .Start; |
| 635 | 637 | }, |
| 636 | 638 | else => { |
test/translate_c.zig+7| ... | ... | @@ -3,6 +3,13 @@ const builtin = @import("builtin"); |
| 3 | 3 | const Target = @import("std").Target; |
| 4 | 4 | |
| 5 | 5 | pub fn addCases(cases: *tests.TranslateCContext) void { |
| 6 | cases.add("macro line continuation", | |
| 7 | \\#define FOO -\ | |
| 8 | \\BAR | |
| 9 | , &[_][]const u8{ | |
| 10 | \\pub const FOO = -BAR; | |
| 11 | }); | |
| 12 | ||
| 6 | 13 | cases.add("function prototype translated as optional", |
| 7 | 14 | \\typedef void (*fnptr_ty)(void); |
| 8 | 15 | \\typedef __attribute__((cdecl)) void (*fnptr_attr_ty)(void); |