forked from pearu/f2py
-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
In addition to include statements which are recognised as Include_Stmt AST nodes, it would be very useful to allow generic pre-processor directives (eg. #define or #idfef) to be internalised under some generic Directive AST node to prevent parser failures on source files that have not been pre-processed yet. This would allow source-to-source translator tools to deal with non-conformant directives downstream and thus become less intrusive to existing code.
If this is a problem for other use cases, it might also be possible to specialise this behaviour with a flag, something like
reader = FortranStringReader(fcode, ignore_comments=False, allow_directives=True)
I'm happy to provide a PR - just looking for some confirmation that this is ok and possibly some pointers where to start.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels