Skip to content

Commit 0c03054

Browse files
committed
Work
1 parent 0531bb5 commit 0c03054

File tree

3 files changed

+7
-105
lines changed

3 files changed

+7
-105
lines changed

Cargo.lock

-70
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ dirs = "5.0.1"
3131
dotenvy = "0.15"
3232
edit-distance = "2.0.0"
3333
glob = "0.3.1"
34-
globset = "0.4.15"
35-
globwalk = "0.9.1"
3634
heck = "0.5.0"
3735
lexiclean = "0.0.1"
3836
libc = "0.2.0"

src/compiler.rs

+7-33
Original file line numberDiff line numberDiff line change
@@ -79,43 +79,18 @@ impl Compiler {
7979
let has_glob = import_base_str.find('*').is_some();
8080

8181
if has_glob {
82-
let walker = globwalk::glob_builder(import_base_str)
83-
.build()
84-
.map_err(|_err| Error::ImportGlob {
85-
error: "FIX ERR".to_string(),
86-
path: *path,
87-
})?;
88-
for maybe_entry in walker {
89-
let Ok(entry) = maybe_entry else { continue };
90-
let import = entry.path().to_owned();
91-
println!("IMPORT: {}", import.display());
92-
93-
if import.is_file() {
94-
if current.file_path.contains(&import) {
95-
return Err(Error::CircularImport {
96-
current: current.path,
97-
import,
98-
});
99-
}
100-
absolute_paths.push(import.clone());
101-
stack.push(current.import(import, path.offset));
102-
}
103-
}
104-
105-
/*
106-
let glob = globset::Glob::new(&import_base_str).map_err(|_err|
107-
Error::ImportGlob { error: "FIX ERR".to_string(), path: *path }
108-
)?.compile_matcher();
109-
*/
110-
/*
111-
11282
let glob_options = glob::MatchOptions {
11383
case_sensitive: true,
11484
require_literal_separator: false,
11585
require_literal_leading_dot: false,
11686
};
117-
let import_paths = glob::glob_with(&import_base_str, glob_options)
118-
.map_err(|error| Error::ImportGlob { error, path: *path })?;
87+
let import_paths =
88+
glob::glob_with(&import_base_str, glob_options).map_err(|error| {
89+
Error::ImportGlob {
90+
error: error.to_string(),
91+
path: *path,
92+
}
93+
})?;
11994
for import in import_paths {
12095
let Ok(import) = import else { continue };
12196

@@ -130,7 +105,6 @@ impl Compiler {
130105
stack.push(current.import(import, path.offset));
131106
}
132107
}
133-
*/
134108
} else if import.is_file() {
135109
if current.file_path.contains(&import) {
136110
return Err(Error::CircularImport {

0 commit comments

Comments
 (0)