Compare commits
5 commits
master
...
zig-develo
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d5342e695 | |||
| 30b295209b | |||
| 8262340c56 | |||
| b4739c6f1f | |||
| 0623e9749e |
5 changed files with 8 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
[tools]
|
[tools]
|
||||||
prek = "0.3.1"
|
prek = "0.3.1"
|
||||||
"ubi:DonIsaac/zlint" = "0.7.9"
|
"ubi:DonIsaac/zlint" = "0.7.9"
|
||||||
zig = "0.16.0"
|
zig = "master"
|
||||||
zls = "0.16.0"
|
zls = "0.16.0"
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.aws = .{
|
.aws = .{
|
||||||
.url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/2fddf4f122198ba64fbb2320e702b317b0b86837/2fddf4f122198ba64fbb2320e702b317b0b86837-with-models.tar.gz",
|
.url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/30b295209b6fdd361eed16dcbcf2f66d78df16da/30b295209b6fdd361eed16dcbcf2f66d78df16danightly-zig-with-models.tar.gz",
|
||||||
.hash = "aws-0.0.1-SbsFcLhoAwQ5TcclMwXhIljwW0Zz_Kcjd4yrIeQq5uHt",
|
.hash = "aws-0.0.1-SbsFcKVHCgDtvJHu64Qnd1Xn5hKjQ3njOe4io8mb16d6",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1453,7 +1453,7 @@ fn camelCaseComp(field: []const u8, key: []const u8, options: ParseOptions) !boo
|
||||||
if (utf8_source_key.nextCodepoint()) |codepoint| {
|
if (utf8_source_key.nextCodepoint()) |codepoint| {
|
||||||
if (codepoint >= 'A' and codepoint <= 'Z') {
|
if (codepoint >= 'A' and codepoint <= 'Z') {
|
||||||
const allocator = options.allocator orelse return error.AllocatorRequired;
|
const allocator = options.allocator orelse return error.AllocatorRequired;
|
||||||
const source_key_camel_case = try allocator.dupeZ(u8, key);
|
const source_key_camel_case = try allocator.dupe(u8, key);
|
||||||
defer allocator.free(source_key_camel_case);
|
defer allocator.free(source_key_camel_case);
|
||||||
// First codepoint is uppercase Latin char, which is all we're handling atm
|
// First codepoint is uppercase Latin char, which is all we're handling atm
|
||||||
source_key_camel_case[0] = source_key_camel_case[0] + ('a' - 'A');
|
source_key_camel_case[0] = source_key_camel_case[0] + ('a' - 'A');
|
||||||
|
|
@ -1504,7 +1504,7 @@ fn snakeCaseComp(field: []const u8, key: []const u8, options: ParseOptions) !boo
|
||||||
|
|
||||||
// We now transform the key by lowercasing. We will only deal with Latin
|
// We now transform the key by lowercasing. We will only deal with Latin
|
||||||
var utf8_source_key = (std.unicode.Utf8View.init(key) catch unreachable).iterator();
|
var utf8_source_key = (std.unicode.Utf8View.init(key) catch unreachable).iterator();
|
||||||
const normalized_key = try allocator.dupeZ(u8, key);
|
const normalized_key = try allocator.dupe(u8, key);
|
||||||
defer allocator.free(normalized_key);
|
defer allocator.free(normalized_key);
|
||||||
inx = 0;
|
inx = 0;
|
||||||
while (utf8_source_key.nextCodepoint()) |codepoint| {
|
while (utf8_source_key.nextCodepoint()) |codepoint| {
|
||||||
|
|
@ -1638,7 +1638,7 @@ fn parseInternal(comptime T: type, token: Token, tokens: *TokenStream, options:
|
||||||
else => return error.UnexpectedToken,
|
else => return error.UnexpectedToken,
|
||||||
}
|
}
|
||||||
var r: T = undefined;
|
var r: T = undefined;
|
||||||
var fields_seen = [_]bool{false} ** structInfo.fields.len;
|
var fields_seen: [structInfo.fields.len]bool = @splat(false);
|
||||||
errdefer {
|
errdefer {
|
||||||
// TODO: why so high here? This was needed for ec2 describe instances
|
// TODO: why so high here? This was needed for ec2 describe instances
|
||||||
@setEvalBranchQuota(100000);
|
@setEvalBranchQuota(100000);
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,7 @@ pub fn Request(comptime request_action: anytype) type {
|
||||||
T: type,
|
T: type,
|
||||||
header_name: []const u8,
|
header_name: []const u8,
|
||||||
};
|
};
|
||||||
comptime var fields = [_]?HeaderInfo{null} ** std.meta.fields(@TypeOf(action.Response.http_header)).len;
|
comptime var fields: [std.meta.fields(@TypeOf(action.Response.http_header)).len]?HeaderInfo = @splat(null);
|
||||||
inline for (std.meta.fields(@TypeOf(action.Response.http_header)), 0..) |f, inx| {
|
inline for (std.meta.fields(@TypeOf(action.Response.http_header)), 0..) |f, inx| {
|
||||||
fields[inx] = HeaderInfo{
|
fields[inx] = HeaderInfo{
|
||||||
.name = f.name,
|
.name = f.name,
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ fn parseInternal(comptime T: type, element: *xml.Element, options: ParseOptions)
|
||||||
},
|
},
|
||||||
.@"struct" => |struct_info| {
|
.@"struct" => |struct_info| {
|
||||||
var r: T = undefined;
|
var r: T = undefined;
|
||||||
var fields_seen = [_]bool{false} ** struct_info.fields.len;
|
var fields_seen: [struct_info.fields.len]bool = @splat(false);
|
||||||
var fields_set: u64 = 0;
|
var fields_set: u64 = 0;
|
||||||
// errdefer {
|
// errdefer {
|
||||||
// // TODO: why so high here? This was needed for ec2 describe instances
|
// // TODO: why so high here? This was needed for ec2 describe instances
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue