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.6.tar.gz
(10.5 kB
view hashes)
Built Distribution
Close
Hashes for simplecpreprocessor-2.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01566650e85d511a892ffd8b3d52bba5d33dd9e82f16e5408e89d9aa9b5de162 |
|
MD5 | 237c45dda65f12ea986ebc27335c56ba |
|
BLAKE2b-256 | 5fcf2fa7680265ff827f3a2db2838629a9a3d1980b7f4ed10d6b8e7f13e00f4b |
Close
Hashes for simplecpreprocessor-2.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f57b063fa1f6c1639b3b82f57a2dcd06434fa0088c02b11fc2a4661c01c6710 |
|
MD5 | 5bd2dfaf3e1be2e251de5124fd31cf2d |
|
BLAKE2b-256 | 6f6aac65e459a78e7e67dd1e259f47e8bf3c6f03cd0517f22c95b3acd933ab03 |