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.2.2.tar.gz
(11.0 kB
view hashes)
Built Distribution
Close
Hashes for simplecpreprocessor-2.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e776fc321a178901b804ebacfe2dc77991d08829ebcb90fa4e568a1eeb606d0 |
|
MD5 | 7d2d21ba761894b572332aec46f4a1df |
|
BLAKE2b-256 | a035da88011072c039666dde39bb94c96342d0f7ea9b34398d615b912e01cc4e |
Close
Hashes for simplecpreprocessor-2.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b53be5422ed9e0cce3e6314429f99a63f6ca9e589e6cad82244f7fe153e02f64 |
|
MD5 | 098870ebcc48afc6f265fd0144c4764a |
|
BLAKE2b-256 | d4451157d716abaa8b88cae8fd88dc8146b6f4f5d7358e8011f92a6436f2ee6d |