diff options
| author | 2024-06-15 22:18:34 +0200 | |
|---|---|---|
| committer | 2024-06-16 13:24:01 +0200 | |
| commit | c0193e9247335a6c1688b946325060289405de2a (patch) | |
| tree | 70fc071b940102575d1ce74f7d9312179267c208 /clap.zig | |
| parent | Add installation instructions to README (diff) | |
| download | zig-clap-c0193e9247335a6c1688b946325060289405de2a.tar.gz zig-clap-c0193e9247335a6c1688b946325060289405de2a.tar.xz zig-clap-c0193e9247335a6c1688b946325060289405de2a.zip | |
Update to latest zig0.9.0
See https://github.com/ziglang/zig/pull/19847
Compatibility with Zig 0.13.0 remains unchanged
Diffstat (limited to 'clap.zig')
| -rw-r--r-- | clap.zig | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -132,7 +132,7 @@ fn countParams(str: []const u8) usize { | |||
| 132 | @setEvalBranchQuota(std.math.maxInt(u32)); | 132 | @setEvalBranchQuota(std.math.maxInt(u32)); |
| 133 | 133 | ||
| 134 | var res: usize = 0; | 134 | var res: usize = 0; |
| 135 | var it = mem.split(u8, str, "\n"); | 135 | var it = mem.splitScalar(u8, str, '\n'); |
| 136 | while (it.next()) |line| { | 136 | while (it.next()) |line| { |
| 137 | const trimmed = mem.trimLeft(u8, line, " \t"); | 137 | const trimmed = mem.trimLeft(u8, line, " \t"); |
| 138 | if (mem.startsWith(u8, trimmed, "-") or | 138 | if (mem.startsWith(u8, trimmed, "-") or |
| @@ -1170,7 +1170,7 @@ pub fn help( | |||
| 1170 | 1170 | ||
| 1171 | var first_line = true; | 1171 | var first_line = true; |
| 1172 | var res: usize = std.math.maxInt(usize); | 1172 | var res: usize = std.math.maxInt(usize); |
| 1173 | var it = mem.tokenize(u8, description, "\n"); | 1173 | var it = mem.tokenizeScalar(u8, description, '\n'); |
| 1174 | while (it.next()) |line| : (first_line = false) { | 1174 | while (it.next()) |line| : (first_line = false) { |
| 1175 | const trimmed = mem.trimLeft(u8, line, " "); | 1175 | const trimmed = mem.trimLeft(u8, line, " "); |
| 1176 | const indent = line.len - trimmed.len; | 1176 | const indent = line.len - trimmed.len; |
| @@ -1195,7 +1195,7 @@ pub fn help( | |||
| 1195 | }; | 1195 | }; |
| 1196 | 1196 | ||
| 1197 | const description = param.id.description(); | 1197 | const description = param.id.description(); |
| 1198 | var it = mem.split(u8, description, "\n"); | 1198 | var it = mem.splitScalar(u8, description, '\n'); |
| 1199 | var first_line = true; | 1199 | var first_line = true; |
| 1200 | var non_emitted_newlines: usize = 0; | 1200 | var non_emitted_newlines: usize = 0; |
| 1201 | var last_line_indentation: usize = 0; | 1201 | var last_line_indentation: usize = 0; |
| @@ -1242,7 +1242,7 @@ pub fn help( | |||
| 1242 | try description_writer.newline(); | 1242 | try description_writer.newline(); |
| 1243 | } | 1243 | } |
| 1244 | 1244 | ||
| 1245 | var words = mem.tokenize(u8, line, " "); | 1245 | var words = mem.tokenizeScalar(u8, line, ' '); |
| 1246 | while (words.next()) |word| | 1246 | while (words.next()) |word| |
| 1247 | try description_writer.writeWord(word); | 1247 | try description_writer.writeWord(word); |
| 1248 | 1248 | ||