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.1.tar.gz
(11.0 kB
view hashes)
Built Distribution
Close
Hashes for simplecpreprocessor-2.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8ef3293103f7081e93c3f2d5133b3bcc2312983b46237937aa74e5cd2f7de50 |
|
MD5 | e9c7550bc9a13495e4878774979eb484 |
|
BLAKE2b-256 | 9533851087f56d7aa8313db378f1191fb692377cbd945bdff5ea2598cfc1958a |
Close
Hashes for simplecpreprocessor-2.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51efda90259ba8b5d0da6fa5379c15d4119eaacaa75e91c8b9c9bacda8c8ee63 |
|
MD5 | 024da924020618cb3c106968835477ee |
|
BLAKE2b-256 | 397b27a665412f0aeadad67a671afc7f3ddda09040fdbc4854d4881db5f2995a |