╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ docgen.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1059 try printShell(out, raw_shell_content, true); 1060 }, 1061 .SyntaxBlock => |syntax_block| { 1062 try printSourceBlock(allocator, tokenizer, out, syntax_block, null); 1063 }, 1064 .Code => |code| { 1065 const out_basename = try std.fmt.allocPrint(allocator, "{s}.out", .{ 1066 Dir.path.stem(code.name), 1067 }); 1068 defer allocator.free(out_basename); 1069 1070 const out_path: Path = .{ 1071 .root_dir = code_dir.root_dir, 1072 .sub_path = out_basename, 1073 }; 1074 1075 const contents = out_path.root_dir.handle.readFileAlloc(io, out_path.sub_path, allocator, .unlimited) catch |err| { 1076 return parseError(tokenizer, code.token, "failed opening {f}: {t}", .{ out_path, err }); 1077 }; 1078 defer allocator.free(contents); 1079 1080 try out.writeAll(contents); 1081 }, 1082 .Grammar => { 1083 try printSourceBlock(allocator, tokenizer, out, .{ 1084 .source_type = .peg, 1085 .name = "grammar.peg", 1086 .source_token = undefined, 1087 }, grammar); 1088 }, 1089 } 1090 } 1091 } 1092