| ... | ... | @@ -3103,6 +3103,7 @@ fn transCreateCompoundAssign( |
| 3103 | 3103 | // common case |
| 3104 | 3104 | // c: lhs += rhs |
| 3105 | 3105 | // zig: lhs += rhs |
| 3106 | |
| 3106 | 3107 | if ((is_mod or is_div) and is_signed) { |
| 3107 | 3108 | const op_token = try appendToken(rp.c, .Equal, "="); |
| 3108 | 3109 | const op_node = try rp.c.a().create(ast.Node.InfixOp); |
| ... | ... | @@ -4813,6 +4814,7 @@ pub fn failDecl(c: *Context, loc: ZigClangSourceLocation, name: []const u8, comp |
| 4813 | 4814 | const msg_tok = try appendTokenFmt(c, .StringLiteral, "\"" ++ format ++ "\"", args); |
| 4814 | 4815 | const rparen_tok = try appendToken(c, .RParen, ")"); |
| 4815 | 4816 | const semi_tok = try appendToken(c, .Semicolon, ";"); |
| 4817 | _ = try appendTokenFmt(c, .LineComment, "// {}", .{c.locStr(loc)}); |
| 4816 | 4818 | |
| 4817 | 4819 | const msg_node = try c.a().create(ast.Node.StringLiteral); |
| 4818 | 4820 | msg_node.* = .{ |
| ... | ... | @@ -5049,8 +5051,8 @@ fn transMacroDefine(c: *Context, it: *CTokenList.Iterator, source: []const u8, n |
| 5049 | 5051 | c, |
| 5050 | 5052 | source_loc, |
| 5051 | 5053 | name, |
| 5052 | | "unable to translate C expr: unexpected token {}", |
| 5053 | | .{last.id}, |
| 5054 | "unable to translate C expr: unexpected token .{}", |
| 5055 | .{@tagName(last.id)}, |
| 5054 | 5056 | ); |
| 5055 | 5057 | |
| 5056 | 5058 | node.semicolon_token = try appendToken(c, .Semicolon, ";"); |
| ... | ... | @@ -5157,8 +5159,8 @@ fn transMacroFnDefine(c: *Context, it: *CTokenList.Iterator, source: []const u8, |
| 5157 | 5159 | c, |
| 5158 | 5160 | source_loc, |
| 5159 | 5161 | name, |
| 5160 | | "unable to translate C expr: unexpected token {}", |
| 5161 | | .{last.id}, |
| 5162 | "unable to translate C expr: unexpected token .{}", |
| 5163 | .{@tagName(last.id)}, |
| 5162 | 5164 | ); |
| 5163 | 5165 | _ = try appendToken(c, .Semicolon, ";"); |
| 5164 | 5166 | const type_of_arg = if (expr.id != .Block) expr else blk: { |
| ... | ... | @@ -5476,7 +5478,7 @@ fn parseCPrimaryExpr(c: *Context, it: *CTokenList.Iterator, source: []const u8, |
| 5476 | 5478 | }; |
| 5477 | 5479 | return &node.base; |
| 5478 | 5480 | } else { |
| 5479 | | const token = try appendTokenFmt(c, .IntegerLiteral, "0x{x}", .{source[tok.start + 1 .. tok.end - 1]}); |
| 5481 | const token = try appendTokenFmt(c, .IntegerLiteral, "0x{x}", .{source[tok.start+1..tok.end-1]}); |
| 5480 | 5482 | const node = try c.a().create(ast.Node.IntegerLiteral); |
| 5481 | 5483 | node.* = .{ |
| 5482 | 5484 | .token = token, |
| ... | ... | @@ -5726,8 +5728,8 @@ fn parseCPrimaryExpr(c: *Context, it: *CTokenList.Iterator, source: []const u8, |
| 5726 | 5728 | c, |
| 5727 | 5729 | source_loc, |
| 5728 | 5730 | source[first_tok.start..first_tok.end], |
| 5729 | | "unable to translate C expr: unexpected token {}", |
| 5730 | | .{tok.id}, |
| 5731 | "unable to translate C expr: unexpected token .{}", |
| 5732 | .{@tagName(tok.id)}, |
| 5731 | 5733 | ); |
| 5732 | 5734 | return error.ParseError; |
| 5733 | 5735 | }, |