Skip to content

Commit

Permalink
Work
Browse files Browse the repository at this point in the history
  • Loading branch information
neunenak committed Oct 2, 2024
1 parent 0531bb5 commit 0c03054
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 105 deletions.
70 changes: 0 additions & 70 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ dirs = "5.0.1"
dotenvy = "0.15"
edit-distance = "2.0.0"
glob = "0.3.1"
globset = "0.4.15"
globwalk = "0.9.1"
heck = "0.5.0"
lexiclean = "0.0.1"
libc = "0.2.0"
Expand Down
40 changes: 7 additions & 33 deletions src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,43 +79,18 @@ impl Compiler {
let has_glob = import_base_str.find('*').is_some();

if has_glob {
let walker = globwalk::glob_builder(import_base_str)
.build()
.map_err(|_err| Error::ImportGlob {
error: "FIX ERR".to_string(),
path: *path,
})?;
for maybe_entry in walker {
let Ok(entry) = maybe_entry else { continue };
let import = entry.path().to_owned();
println!("IMPORT: {}", import.display());

if import.is_file() {
if current.file_path.contains(&import) {
return Err(Error::CircularImport {
current: current.path,
import,
});
}
absolute_paths.push(import.clone());
stack.push(current.import(import, path.offset));
}
}

/*
let glob = globset::Glob::new(&import_base_str).map_err(|_err|
Error::ImportGlob { error: "FIX ERR".to_string(), path: *path }
)?.compile_matcher();
*/
/*
let glob_options = glob::MatchOptions {
case_sensitive: true,
require_literal_separator: false,
require_literal_leading_dot: false,
};
let import_paths = glob::glob_with(&import_base_str, glob_options)
.map_err(|error| Error::ImportGlob { error, path: *path })?;
let import_paths =
glob::glob_with(&import_base_str, glob_options).map_err(|error| {
Error::ImportGlob {
error: error.to_string(),
path: *path,
}
})?;
for import in import_paths {
let Ok(import) = import else { continue };

Expand All @@ -130,7 +105,6 @@ impl Compiler {
stack.push(current.import(import, path.offset));
}
}
*/
} else if import.is_file() {
if current.file_path.contains(&import) {
return Err(Error::CircularImport {
Expand Down

0 comments on commit 0c03054

Please sign in to comment.