Skip to content

Commit

Permalink
ASC - non-case sensitive exclude checking, increase debugging (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored Oct 10, 2023
1 parent 6c53a2a commit 23f5c7e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/src/modules/asc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ impl Module for ArmaScriptCompiler {
.asc()
.exclude()
.iter()
.any(|e| entry.as_str().contains(e))
.any(|e| entry.as_str().to_ascii_lowercase().contains(&e.to_ascii_lowercase()))
{
debug!("asc excluded {}", entry);
continue;
}
entries.push(entry);
Expand Down Expand Up @@ -168,7 +169,7 @@ impl Module for ArmaScriptCompiler {
config.add_include_dir(include.display().to_string());
}
for exclude in ctx.config().asc().exclude() {

Check warning on line 171 in bin/src/modules/asc.rs

View workflow job for this annotation

GitHub Actions / ubuntu

unused variable: `exclude`

Check warning on line 171 in bin/src/modules/asc.rs

View workflow job for this annotation

GitHub Actions / windows

unused variable: `exclude`

Check warning on line 171 in bin/src/modules/asc.rs

View workflow job for this annotation

GitHub Actions / beta

unused variable: `exclude`

warning: unused variable: `exclude` --> bin/src/modules/asc.rs:171:13 | 171 | for exclude in ctx.config().asc().exclude() { | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_exclude` | = note: `#[warn(unused_variables)]` on by default

Check warning on line 171 in bin/src/modules/asc.rs

View workflow job for this annotation

GitHub Actions / stable

unused variable: `exclude`

warning: unused variable: `exclude` --> bin/src/modules/asc.rs:171:13 | 171 | for exclude in ctx.config().asc().exclude() { | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_exclude` | = note: `#[warn(unused_variables)]` on by default
config.add_exclude(exclude);
// config.add_exclude(exclude); // not needed because we only demacro sqf that aren't in exclude
}
config.set_worker_threads(num_cpus::get());
let mut f = File::create(tmp.join("sqfc.json"))?;
Expand All @@ -178,6 +179,9 @@ impl Module for ArmaScriptCompiler {
let command = Command::new(tmp.join(SOURCE[0])).output()?;
out_file.write_all(&command.stdout)?;
out_file.write_all(&command.stderr)?;
if String::from_utf8(command.stdout.clone()).unwrap().contains("Parse Error") {
warn!("ASC 'Parse Error' - check .hemttout/asc.log");
}
if command.status.success() {
debug!("ASC took {:?}", start.elapsed().whole_milliseconds());
} else {
Expand All @@ -192,7 +196,8 @@ impl Module for ArmaScriptCompiler {
let from = tmp_output.join(&format!("{src}c"));
let to = ctx.workspace().join(&format!("{dst}c"))?;
if !from.exists() {
// Likely excluded
// sqf that have parse errors OR just empty//no-code
debug!("asc didn't process {}", src);
continue;
}
let mut f = File::open(from)?;
Expand Down

0 comments on commit 23f5c7e

Please sign in to comment.