Fixed for zig master

This commit is contained in:
Alexandros Naskos 2021-02-15 12:04:22 +02:00
parent fa496936f5
commit a886ecddd9
No known key found for this signature in database
GPG Key ID: 02BF2E72B0EA32D2
2 changed files with 13 additions and 4 deletions

View File

@ -23,7 +23,7 @@ fn Transform(comptime Original: type, comptime transform_fn: anytype) type {
};
}
inline fn fromDynamicTreeInternal(arena: *std.heap.ArenaAllocator, value: std.json.Value, out: anytype) error{ MalformedJson, OutOfMemory }!void {
fn fromDynamicTreeInternal(arena: *std.heap.ArenaAllocator, value: std.json.Value, out: anytype) error{ MalformedJson, OutOfMemory }!void {
const T = comptime std.meta.Child(@TypeOf(out));
if (comptime std.meta.trait.is(.Struct)(T)) {

View File

@ -43,7 +43,7 @@ pub const TokenModifiers = packed struct {
return res;
}
inline fn set(self: *TokenModifiers, comptime field: []const u8) void {
fn set(self: *TokenModifiers, comptime field: []const u8) callconv(.Inline) void {
@field(self, field) = true;
}
};
@ -88,11 +88,20 @@ const Builder = struct {
}
};
inline fn writeToken(builder: *Builder, token_idx: ?ast.TokenIndex, tok_type: TokenType) !void {
fn writeToken(
builder: *Builder,
token_idx: ?ast.TokenIndex,
tok_type: TokenType,
) callconv(.Inline) !void {
return try writeTokenMod(builder, token_idx, tok_type, .{});
}
inline fn writeTokenMod(builder: *Builder, token_idx: ?ast.TokenIndex, tok_type: TokenType, tok_mod: TokenModifiers) !void {
fn writeTokenMod(
builder: *Builder,
token_idx: ?ast.TokenIndex,
tok_type: TokenType,
tok_mod: TokenModifiers,
) callconv(.Inline) !void {
if (token_idx) |ti| {
try builder.add(ti, tok_type, tok_mod);
}