PCPP now includes a decent expression evaluator instead of relying on Python's, therefore our evaluator is removed. The corresponding license text no longer applies, because the snippet that used it has been removed.
This patch also corrects the handling of include files, which was supposed to raise an exception or return something (and now it needs an extra parameter). We just report an error and raise the special exception that pcpp uses to ignore and remove the directive.
This patch also handles #error and invalid directives, which were passed through in previous versions. #warning and #line are also passed through.
These changes make it ready for prime time, but main.py still does not expose the functionality.
Changes include:
- Instead of passing paths, we pass parameters, which are parsed to extract the paths (no syspaths, only regular paths) and the defines.
- Errors in the preprocessor are reported to the caller (i.e. to main).
Includes PCPP as a submodule (which in turn pulls PLY as a submodule, so be sure to initialize submodules recursively). Also includes a file to interface PCPP with the optimizer, patching its behaviour according to our needs.
Special thanks to Niall Douglas and David Bezley for authoring PCPP.