-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Fix use of keyword args for intrinsic functions #3075
Conversation
Thanks for working on this, very helpful. |
7101ec7
to
5e27957
Compare
@@ -4196,7 +4196,7 @@ class CommonVisitor : public AST::BaseVisitor<Derived> { | |||
|
|||
ASR::asr_t* create_ArraySize(const AST::FuncCallOrArray_t& x) { | |||
Vec<ASR::expr_t*> args; | |||
std::vector<std::string> kwarg_names = {"dim", "kind"}; | |||
std::vector<std::string> kwarg_names = {"array", "dim", "kind"}; | |||
handle_intrinsic_node_args(x, args, kwarg_names, 1, 3, std::string("size")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's separate these changes into another PR. But would modify the handle_intrinsic_node_args
function to rename kwarg_names
to just arg_names
which would list all arguments, and then the min/max arg number would still be 1, 3
in this case, and everything should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even later we can then refactor these to use the model in #3090.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example the function handle_intrinsic_node_args
can just access the name2signature
dictionary to access the information.
I made this a draft for now. Once you address #3075 (comment) then make it ready for review again. |
5e27957
to
78404c0
Compare
c59ef30
to
8955b40
Compare
@certik this is ready. Can you please review it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good, thanks!
Fixes: #3053
Towards: #3052
With this PR, I'm handling the presence of keywords with the args in intrinsic functions - #3053 (comment)
This should help in resolving the issue while building
stdlib
, however there are still changes that need to be done.