| ... | ... | @@ -7,24 +7,16 @@ const usage = |
| 7 | 7 | \\ |
| 8 | 8 | ; |
| 9 | 9 | |
| 10 | | const Transformation = enum { |
| 11 | | none, |
| 12 | | }; |
| 13 | | |
| 14 | 10 | // Roadmap: |
| 15 | 11 | // - add the main loop that checks for interestingness |
| 16 | 12 | // - add transformations |
| 17 | | // - gut function |
| 18 | | // - replace body with `@trap();` |
| 19 | | // - discard the parameters |
| 20 | 13 | // - add thread pool |
| 21 | 14 | // - add support for `@import` detection and other files |
| 15 | // - reduce flags sent to the compiler |
| 22 | 16 | |
| 23 | 17 | pub fn main(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 24 | 18 | const file_path = args[2]; |
| 25 | | const transformation = std.meta.stringToEnum(Transformation, args[3]); |
| 26 | | |
| 27 | | assert(transformation == .none); |
| 19 | const transformation_index = try std.fmt.parseInt(u32, args[3], 0); |
| 28 | 20 | |
| 29 | 21 | const source_code = try std.fs.cwd().readFileAllocOptions( |
| 30 | 22 | arena, |
| ... | ... | @@ -46,8 +38,7 @@ pub fn main(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 46 | 38 | rendered.clearRetainingCapacity(); |
| 47 | 39 | |
| 48 | 40 | var gut_functions: std.AutoHashMapUnmanaged(u32, void) = .{}; |
| 49 | | try gut_functions.put(arena, 1, {}); |
| 50 | | try gut_functions.put(arena, 3, {}); |
| 41 | try gut_functions.put(arena, transformation_index, {}); |
| 51 | 42 | |
| 52 | 43 | try tree.renderToArrayList(&rendered, .{ |
| 53 | 44 | .gut_functions = gut_functions, |