OpenVAF
OpenVAF copied to clipboard
macro call parsing issue
If I have `define myexp exp and then call it with y = `myexp(5.0); OpenVAF complains error: argument mismatch expected 0 but found 1!
If I do y = `myexp (5.0); then it works fine -- note the space before the open-parenthesis.
The parser properly looks for an open-parenthesis when parsing the define: if it finds a parenthesis before any whitespace, then there are arguments for that macro. But when parsing the call, this is not the proper way to determine whether there are arguments.
Interestingly, it seems that the parser can support a macro call in the formal arguments:
`define myadd(arg1,
arg2) (arg1) + (
arg2)
which seems a little weird. parse_define calls parse_macro_token, which can get macros.