You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I have a way to fix this, but it's inefficient, because it clones the AHashMap for the macros, in order to be able to look up the number of arguments for the macro, to know if the macro call should have any.
gjcoram
added a commit
to gjcoram/OpenVAF
that referenced
this issue
Jul 14, 2024
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.
The text was updated successfully, but these errors were encountered: