Conversation
Also set the value on fmt_func instead of fmt_result since the function is generic and not the result.
It is only set on fmt_func now. fmt_result worked since its parent is fmt_func.
Moved from generate.py
Have fcfmt.py match wrapf.py
Use reeval_template to avoid the inlocal in eval_template. It is only called when needed instead of for each function. Since options.F_create_generic is tested before setting, it is no longer set for functions which are templated on their result (since Fortran cannot create a generic interface for those functions). This changes some JSON files. Update from user_fmt after function_fmt is set since F_name_generic may be set in the YAML file by the user.
fmt_func is updated form user_fmt afterwards so the user values is take priority. Working to remove inlocal if possible.
Before computed in ast.py. user_dict is used to update as the final step. fill_typedef_typemap is then called. update_names is a no-op and can be removed later. Its contents were moved into fcfmt.py. Changes to JSON files: python-only - c_type, C_name_typedef, are no longer defined since it is not going through fcfmt.py templates - std::vector::size_type does not update the typemap, only the instantiations of std::vector. typedefs-c - Properly apply typedef format fields to set C_name_typedef. This propogates to other format fields.
The work is now done in fcfmt.py.
It was being called from ast.py earlier. Now it is called after templates are instantiated in generate.py. Added test error-fmt and moved some tests from error-ast. error-ast is correctly stopping because of errors and never calls fill_typedef_typemap from its new location. Test error-fmt has no AST errors. Changes to JSON files. python-only - Fills in fields in typedef TypeID. c_type is unchanged when created by declast.py since fill_typedef_typemap is no longer called where C_name_typedef is unset. templates - Fills in fields in uninstantiated std::vector::size_type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of setting in ast.py, set in fcfmt.py which is called after generate.py. This allows format fields to be properly set for generate functions like template instantiations and other generated functions.