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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for simplecpreprocessor-2.2.1.tar.gz
Algorithm Hash digest
SHA256 c8ef3293103f7081e93c3f2d5133b3bcc2312983b46237937aa74e5cd2f7de50
MD5 e9c7550bc9a13495e4878774979eb484
BLAKE2b-256 9533851087f56d7aa8313db378f1191fb692377cbd945bdff5ea2598cfc1958a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simplecpreprocessor-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51efda90259ba8b5d0da6fa5379c15d4119eaacaa75e91c8b9c9bacda8c8ee63
MD5 024da924020618cb3c106968835477ee
BLAKE2b-256 397b27a665412f0aeadad67a671afc7f3ddda09040fdbc4854d4881db5f2995a

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