Split JS parser into multiple files (#20880)

Splits up js_parser.zig into multiple files. Also changes visitExprInOut
to use function calls rather than switch

Not ready:

- [ ] P.zig is ~70,000 tokens, still needs to get smaller
- [x] ~~measure zig build time before & after (is it slower?)~~ no
significant impact

---------

Co-authored-by: pfgithub <6010774+pfgithub@users.noreply.github.com>
This commit is contained in:
pfg
2025-08-05 20:52:16 -07:00
committed by GitHub
parent 04883a8bdc
commit a72d74e09a
32 changed files with 24962 additions and 23844 deletions

View File

@@ -1462,10 +1462,6 @@ pub fn concat(comptime T: type, dest: []T, src: []const []const T) void {
}
}
pub const fast_debug_build_cmd = .None;
pub const fast_debug_build_mode = fast_debug_build_cmd != .None and
Environment.isDebug;
pub const renamer = @import("./renamer.zig");
// TODO: Rename to SourceMap as this is a struct.
pub const sourcemap = @import("./sourcemap/sourcemap.zig");
@@ -1481,10 +1477,8 @@ pub fn asByteSlice(buffer: anytype) []const u8 {
}
comptime {
if (fast_debug_build_cmd != .RunCommand and fast_debug_build_mode) {
_ = @import("./bun.js/node/buffer.zig").BufferVectorized.fill;
_ = @import("./cli/upgrade_command.zig").Version;
}
_ = @import("./bun.js/node/buffer.zig").BufferVectorized.fill;
_ = @import("./cli/upgrade_command.zig").Version;
}
pub fn DebugOnlyDisabler(comptime Type: type) type {