-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't parse when resetall is present and module has multiple parameters #89
Comments
This is how I'm processing it btw: let mut defines = HashMap::new();
let includes = Vec<PathBuf>::new();
let res = preprocess(&path, &defines, &includes, false, false);
match res {
Ok((text, new_defines)) => {
println!("Yay!");
let orig = String::from(text.text());
let res = parse_sv_pp(text, new_defines, false);
match res {
Ok((syntax, new_defines)) => {
println!("yay again!");
}
Err(x) => { // <- this is the error I get
println!("booo (2)");
debug_println!("{:?}", x);
print!("{}", orig);
}
}
}
Err(err) => {
println!("Boo!");
}
} The output is:
|
I can reproduce this with svlint v0.9.0. `ifdef DIRECTIVE_RESETALL
`resetall
`endif// DIRECTIVE_RESETALL
module M
#(
P
`ifdef SECOND_PARAM
,
`ifdef KEYWORD_PARAMETER
parameter
`endif// KEYWORD_PARAMETER
Q
`endif// SECOND_PARAM
) () ; endmodule Omitting any of the preprocessor defines avoids the parse error. I must define all 3 before I see the parse error:
Output from the preprocessor looks good:
Sorry @charletes, I don't know why this happens, but hopefully it's good to know that it's not just you. |
Thanks for looking into it! I'll try to catch where the tool breaks down but I'm not familiar with the code so it may take a while. |
Unfortunately I don't understand enough of the internals to figure out where things go awry. I had a look at the parsing process and it seems to follow the syntax definition to a tee, but somehow the "resetall" gets things in the wrong state. I did a really ugly workaround that works for me, using the preprocessor first, removing all the resetall statements, and then parsing the resulting string. |
Any progress on this? I also encountered an issue with an internal design using `resetall macro. But the error position points to random things. |
Hi, I'm trying to parse the following code and it fails when reaching the
#
:However, this works:
This one also works:
Any idea about how to proceed?
The text was updated successfully, but these errors were encountered: