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.3.tar.gz
(10.2 kB
view hashes)
Built Distribution
Close
Hashes for simplecpreprocessor-2.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1516b640331a39936397614a210089e56e2dd66b87fdb76d5484e6efd0dd72e |
|
MD5 | 8f66d7c7e4669fba515b7c690ed7c620 |
|
BLAKE2b-256 | 8c6dd100d24c7998e48be1e88fa2462af68281b178b498112d1bed113e4c0f42 |
Close
Hashes for simplecpreprocessor-2.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddfb193047c76d0c66d84a3cd60e1c792da70cbe910822780656882089746103 |
|
MD5 | 9840ef114635e637165af0f890ba75ea |
|
BLAKE2b-256 | d0fadf30b1db2af4703bd4002ab988fa5a0da5fa5830cac464b4dafa88d6b197 |