Skip to main content

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.3.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

simplecpreprocessor-2.3.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file simplecpreprocessor-2.3.0.tar.gz.

File metadata

  • Download URL: simplecpreprocessor-2.3.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for simplecpreprocessor-2.3.0.tar.gz
Algorithm Hash digest
SHA256 b5c4b57876824fbd1fd71ec131f78b81a3b30aa3f8b55a41fe303dc60dca41cf
MD5 f154f75cbfe06387b2ef7a0baccdd679
BLAKE2b-256 4b0b18f86a9e24444b60709872e37d83f5787015509e7d4daa644ea519bffa67

See more details on using hashes here.

File details

Details for the file simplecpreprocessor-2.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simplecpreprocessor-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a20475ccd12df081e98a76318bf2019914acdce152f17059014a5afb692a091a
MD5 8f8a334267df68ae2946750138bdf1d2
BLAKE2b-256 cbbc3852ab3221e0b466ce4c07a1f92acd6bbb1988024dee653d6e098c74fa23

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page