simplepreprocessor expands limited set of C preprocessor macros
Project description
simplepreprocessor
Usage
import simplecpreprocessor
There will be one function called preprocess. It can either be called with a file object or something that looks sufficiently like a file object. See unit tests to find out what's enough for a compatible wrapper. Line endings are by default normalized to unix but a parameter can be given to customize this behaviour.
Gotchas
Supported macros: ifdef, ifndef, define, undef, include, else, pragma (only "once")
If using for FFI, you may want to ignore some system headers eg for types
Limitations:
- Multiline continuations supported but whitespace handling may not be 1:1 with real preprocessors. Trailing whitespace is removed if before comment, indentation from first line is removed
- Semi-colon handling may not be identical to real preprocessors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simplecpreprocessor-2.3.2.tar.gz
(10.7 kB
view hashes)
Built Distribution
Close
Hashes for simplecpreprocessor-2.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d41a311bf9dbe116d3047af53b3be4fdc8a31ae5aedf2f4dc7e3910a0fe8846 |
|
MD5 | 036315dc551c6cb82c790e5ea77a6a1c |
|
BLAKE2b-256 | ab930743642792251d75d9b8c47fbfa040de31ad9602e77c10a3311c8701856e |
Close
Hashes for simplecpreprocessor-2.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b14b5ac6e27b9e1ddcde23ff58e37837cac31c6c23a88ab5a346cbe11df8406b |
|
MD5 | f0ef21cd6e6ac8c442b8d9e06d5173c7 |
|
BLAKE2b-256 | fdd95d204a2ced2f208b03630b7a9737958a29e424dfa8af3416bf016268c60b |