Skip to content

Commit 8866bef

Browse files
committedJun 22, 2018
clean up self hosted main. delete unsupported commands
·
0.15.20.3.0
1 parent be2a4c4 commit 8866bef

File tree

4 files changed

+121
-459
lines changed

4 files changed

+121
-459
lines changed
 

‎src-self-hosted/arg.zig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub const Args = struct {
168168
}
169169

170170
// e.g. --names value1 value2 value3
171-
pub fn many(self: *Args, name: []const u8) ?[]const []const u8 {
171+
pub fn many(self: *Args, name: []const u8) []const []const u8 {
172172
if (self.flags.get(name)) |entry| {
173173
switch (entry.value) {
174174
FlagArg.Many => |inner| {
@@ -177,7 +177,7 @@ pub const Args = struct {
177177
else => @panic("attempted to retrieve flag with wrong type"),
178178
}
179179
} else {
180-
return null;
180+
return []const []const u8{};
181181
}
182182
}
183183
};

‎src-self-hosted/main.zig‎

Lines changed: 116 additions & 430 deletions
Large diffs are not rendered by default.

‎src-self-hosted/module.zig‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -103,30 +103,6 @@ pub const Module = struct {
103103
LlvmIr,
104104
};
105105

106-
pub const CliPkg = struct {
107-
name: []const u8,
108-
path: []const u8,
109-
children: ArrayList(*CliPkg),
110-
parent: ?*CliPkg,
111-
112-
pub fn init(allocator: *mem.Allocator, name: []const u8, path: []const u8, parent: ?*CliPkg) !*CliPkg {
113-
var pkg = try allocator.create(CliPkg{
114-
.name = name,
115-
.path = path,
116-
.children = ArrayList(*CliPkg).init(allocator),
117-
.parent = parent,
118-
});
119-
return pkg;
120-
}
121-
122-
pub fn deinit(self: *CliPkg) void {
123-
for (self.children.toSliceConst()) |child| {
124-
child.deinit();
125-
}
126-
self.children.deinit();
127-
}
128-
};
129-
130106
pub fn create(
131107
allocator: *mem.Allocator,
132108
name: []const u8,

‎test/cases/bugs/1111.zig‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const Foo = extern enum {
55
test "issue 1111 fixed" {
66
const v = Foo.Bar;
77

8-
switch(v) {
9-
Foo.Bar => return,
10-
else => return,
8+
switch (v) {
9+
Foo.Bar => return,
10+
else => return,
1111
}
1212
}

0 commit comments

Comments
 (0)
Please sign in to comment.