rename ascii.zig -> match.zig

This commit is contained in:
Zack Radisic
2025-02-12 18:10:38 -08:00
parent 94e05d56c1
commit 7df29b6146
5 changed files with 8 additions and 8 deletions

View File

@@ -391,7 +391,7 @@ pub fn match(this: *Glob, globalThis: *JSGlobalObject, callframe: *JSC.CallFrame
var str = try str_arg.toSlice(globalThis, arena.allocator());
defer str.deinit();
return JSC.JSValue.jsBoolean(globImpl.Ascii.match(arena.allocator(), this.pattern, str.slice()).matches());
return JSC.JSValue.jsBoolean(globImpl.match(arena.allocator(), this.pattern, str.slice()).matches());
}
pub fn convertUtf8(codepoints: *std.ArrayList(u32), pattern: []const u8) !void {

View File

@@ -1,5 +1,7 @@
pub const walk = @import("./glob/GlobWalker.zig");
pub const Ascii = @import("./glob/ascii.zig");
pub const match_impl = @import("./glob/match.zig");
pub const match = match_impl.match;
pub const detectGlobSyntax = match_impl.detectGlobSyntax;
pub const GlobWalker = walk.GlobWalker_;
pub const BunGlobWalker = GlobWalker(null, walk.SyscallAccessor, false);

View File

@@ -41,7 +41,7 @@ const Codepoint = CodepointIterator.Cursor.CodePointType;
const Dirent = @import("../bun.js/node/types.zig").Dirent;
const DirIterator = @import("../bun.js/node/dir_iterator.zig");
const EntryKind = @import("../bun.js/node/types.zig").Dirent.Kind;
const GlobAscii = @import("./ascii.zig");
const match = @import("./match.zig").match;
const JSC = bun.JSC;
const Maybe = JSC.Maybe;
const PathLike = @import("../bun.js/node/types.zig").PathLike;
@@ -337,8 +337,6 @@ pub fn GlobWalker_(
/// not owned by this struct
pattern: []const u8 = "",
cp_len: u32 = 0,
/// If the pattern contains "./" or "../"
has_relative_components: bool = false,
@@ -1333,7 +1331,7 @@ pub fn GlobWalker_(
}
fn matchPatternSlow(this: *GlobWalker, pattern_component: *Component, filepath: []const u8) bool {
return GlobAscii.match(
return match(
this.arena.allocator(),
pattern_component.patternSlice(this.pattern),
filepath,
@@ -1729,4 +1727,4 @@ pub fn matchWildcardLiteral(literal: []const u8, path: []const u8) bool {
return std.mem.eql(u8, literal, path);
}
pub const matchImpl = GlobAscii.match;
pub const matchImpl = match;

View File

@@ -5045,7 +5045,7 @@ pub const Package = extern struct {
if (input_path.len == 0 or input_path.len == 1 and input_path[0] == '.') continue;
if (Glob.Ascii.detectGlobSyntax(input_path)) {
if (Glob.detectGlobSyntax(input_path)) {
workspace_globs.append(input_path) catch bun.outOfMemory();
continue;
}