Rewrite Fortran expression as f2py supported C expression. Due to the lack of a proper expression parser in f2py, this function uses a heuristic approach that assumes that Fortran arithmetic expressions are valid C arithmetic expressions when mapping Fortran function calls to the co
(expr)
| 240 | |
| 241 | |
| 242 | def f2cexpr(expr): |
| 243 | """Rewrite Fortran expression as f2py supported C expression. |
| 244 | |
| 245 | Due to the lack of a proper expression parser in f2py, this |
| 246 | function uses a heuristic approach that assumes that Fortran |
| 247 | arithmetic expressions are valid C arithmetic expressions when |
| 248 | mapping Fortran function calls to the corresponding C function/CPP |
| 249 | macros calls. |
| 250 | |
| 251 | """ |
| 252 | # TODO: support Fortran `len` function with optional kind parameter |
| 253 | expr = re.sub(r'\blen\b', 'f2py_slen', expr) |
| 254 | return expr |
| 255 | |
| 256 | |
| 257 | def getstrlength(var): |
no outgoing calls
no test coverage detected
searching dependent graphs…