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.1.2.tar.gz
(10.3 kB
view hashes)
Built Distribution
Close
Hashes for simplecpreprocessor-2.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5e31c5fbd3725d120d6245f811d8ee5c01d01cc4ceb8f709efc6dd22da39944 |
|
MD5 | f2df6f11caba792a8e8ac1d80ac58aff |
|
BLAKE2b-256 | 65e3e61a6951debc551804dd2e26b2fc1bbb2170e4445fd5e46dd10cc1af7359 |
Close
Hashes for simplecpreprocessor-2.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c127da97273ca7c0b50f628eff4b7448be2dfa573c7fdc88a9776f7943b5ff7 |
|
MD5 | 341fa6caf3ea7dcd2323804e6132d8c3 |
|
BLAKE2b-256 | ccdc427b4e8a8f4a09b8bd751c871c0cd5d063be5356f04e61179f75637593a1 |