stfc / fparser

This project maintains and develops a Fortran parser called fparser2 written purely in Python which supports Fortran 2003 and some Fortran 2008. A legacy parser fparser1 is also available but is not supported. The parsers were originally part of the f2py project by Pearu Peterson.
https://fparser.readthedocs.io
Other
64 stars 29 forks source link

Use association of operators not captured in SymbolTable. #379

Open arporter opened 2 years ago

arporter commented 2 years ago

Processing some LFRic code, fparser fails:

File "/home/kbc59144/Projects/fparser/src/fparser/two/Fortran2003.py", line 10307, in match
raise InternalError(
fparser.two.utils.InternalError: 'An Only_List can contain only Name or Rename entries but found 'Generic_Spec' when matching 'use xios,                 only: xios_get_field_attr, xios_get_axis_attr,                                       xios_get_file_attr,                                                            xios_recv_field, xios_date, xios_duration,                                     xios_get_current_date, xios_get_time_origin,                                   xios_get_year_length_in_seconds,                                               xios_date_convert_to_seconds, operator(-),                                     operator(+), operator(<), operator(<=)''. Please report this to the authors.

where the problem is that we have use ios, only: ..., operator(-) and the changes I've made recently to handle use association don't support that form.

arporter commented 2 years ago

380 will fix the crash but won't add support for operators to the symbol table so this Issue remains to be done.