Skip to content

Commit

Permalink
update to a2lfile 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielT committed Dec 5, 2024
1 parent d4a2c73 commit 4415aca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
a2lfile = "2.3.2"
a2lfile = "2.4.0"
object = { version = "~0.36", default-features = false, features = ["read"] }
gimli = { version = "~0.31", default-features = false, features = ["read"] }
memmap2 = "~0.9"
Expand Down
17 changes: 14 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@ fn core(args: impl Iterator<Item = OsString>) -> Result<(), String> {
if let Some(merge_modules) = arg_matches.get_many::<OsString>("MERGEMODULE") {
for merge_module_path in merge_modules {
let mut load_log_msgs = Vec::<A2lError>::new();
let load_result = a2lfile::load(merge_module_path, None, &mut load_log_msgs, strict);
let load_result = a2lfile::load(
merge_module_path,
Some(ifdata::A2MLVECTOR_TEXT.to_string()),
&mut load_log_msgs,
strict,
);

if let Ok(mut merge_a2l) = load_result {
// display any log messages from the load
Expand All @@ -238,7 +243,10 @@ fn core(args: impl Iterator<Item = OsString>) -> Result<(), String> {
merge_module_path.to_string_lossy()
)
);
} else if let Ok(mut other_module) = a2lfile::load_fragment_file(merge_module_path) {
} else if let Ok(mut other_module) = a2lfile::load_fragment_file2(
merge_module_path,
Some(ifdata::A2MLVECTOR_TEXT.to_string()),
) {
// failed to load the file as a full A2L file, but loaded it as a module fragment
a2l_file.project.module[0].merge(&mut other_module);
cond_print!(
Expand Down Expand Up @@ -546,7 +554,10 @@ fn load_or_create_a2l(
},
) if block == "A2L_FILE" => {
// parse error in the outermost block "A2L_FILE" could indicate that this is an a2l fragment containing only the content of a MODULE
if let Ok(module) = a2lfile::load_fragment_file(input_filename) {
if let Ok(module) = a2lfile::load_fragment_file2(
input_filename,
Some(ifdata::A2MLVECTOR_TEXT.to_string()),
) {
// successfully loaded a module, now upgrade it to a full file
let mut a2l_file = a2lfile::new();
a2l_file.project.module[0] = module;
Expand Down

0 comments on commit 4415aca

Please sign in to comment.