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.1.tar.gz
(10.7 kB
view hashes)
Built Distribution
Close
Hashes for simplecpreprocessor-2.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bae8b9556a8889fe40cfee07f48da09d07c34b2cee0e647eec4858acf7ca60f0 |
|
MD5 | db037bfbde3161ea8a89f98171fb2edd |
|
BLAKE2b-256 | 869fffeb010bc052783badb6ac509be083c4e811d2ab0bfcd3a436c3b6b2772f |
Close
Hashes for simplecpreprocessor-2.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7038d6f9b4e04909432d868af2e288c2a2d718a231176c94c6b5c5dfb4dd390 |
|
MD5 | 0174cf7bf5198528ff0ebb462e08d59f |
|
BLAKE2b-256 | ebe80ab08f92b1218eecc60de0a869a1d458364ae2a0f536bc790d85c11b0483 |