Let the user parse a file from the Python API. #1
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.
For now, parsing file containing preprocessors directives through the python API seems broken.
For instance with this file:
It works fine when using fxtran, but when using the python wrapper the parsing fail:
The problem seems to arise because the code is never preprocessed. Indeed, when FXTRAN_RUN is called with the 'Text' variable being not NULL, the preprocessor is never called. The preprocessor is only called when a file is given.
In consequence this problem can be fixed in the Python API by letting the user provide a file instead of a string containing the code. It will be then fxtran's job to open the file and fxtran will preprocess it.
It also ease the use of the Python API since the user don't have to open a file and read it on the python side just to give it to fxtran. The user can now just give a filename and get the resulting xml.