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.0.tar.gz
(10.5 kB
view hashes)
Built Distribution
Close
Hashes for simplecpreprocessor-2.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58d86fe9289cf54d04dd66255e9d50a65b3c35812d4ca1a9bb8eab6b77f18ec6 |
|
MD5 | 4b333df4e1e949b109f1869a36e63c0d |
|
BLAKE2b-256 | 2966433a2ca34cebeb05939044b50c911ebf2be2240b7cc45448ddce38452f83 |
Close
Hashes for simplecpreprocessor-2.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4fac1eb88cad303f8afbe62aa97a977478c37415ada0927b0f429ec3f0e4e11 |
|
MD5 | 1081ad7426218662b88d6d8dbd4129b7 |
|
BLAKE2b-256 | a806b4d136e37f1e4907dd86a8dc3a0f325c5dd38d890c1bf5492f87ca756aaa |