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

This version

2.3.4

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplecpreprocessor-2.3.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for simplecpreprocessor-2.3.4.tar.gz
Algorithm Hash digest
SHA256 691b49deaca0f5a783ae69d595d23196fe00b64817f26e98c1bec426158db2d8
MD5 cfc80b04fd86ff3cb07c8388d670b69f
BLAKE2b-256 6057a9957d1e9678fac79d13ed47286a3469e622eadd86179cded005b68e9a42

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for simplecpreprocessor-2.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ae7403b5627d2c7ddcd78f3f2fc77339b047e6567a15fa44bd684af020e9ec2e
MD5 6c913dc6138f366e8df8afcb5b8cb7ce
BLAKE2b-256 2acd8ff278e2affb93b1d28124f9b0f36e26ab9f0fc65f7b00478381ad9c1856

See more details on using hashes here.

Provenance

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