preproc

Crates.iopreproc
lib.rspreproc
version0.2.0
sourcesrc
created_at2022-07-15 12:00:00.304421
updated_at2023-04-07 11:12:35.993189
descriptiona sane pre-processor for shaders and any other language
homepage
repositoryhttps://github.com/lassade/preproc
max_upload_size
id626162
size186,716
Felipe Jorge (lassade)

documentation

https://docs.rs/preproc

README

preproc

Simple and configurable SIMD pre-processor, with a throughput of up to 3 GiB/s

Quirks and Other Notes

  • Booleans only
  • UTF-8 only
  • SSE2 required, no NEON support for the time been
  • Whitespaces are considered to be ' ' (0x20) and '\t' (0x09)
  • Multiline comments aren't supported, (they work in some situations, but is best to avoid them)
  • Unary operators can be placed on left e.g. !a == a! and !(a && b) == (a && b)!
  • Expressions are some what loosely parsed e.g. b && a c! || is parsed as (b || (a && !(c)))

Samples

//#if MY_MACRO // this directive is commented out
#if MY_OTHER_MACRO || MY_MACRO // this directive is active, single line comments are fine
// your code here
            #endif // doesn't care about white spaces as long the '#' is the frist char in the line
// invalid multiline comments
/*#if MY_MACRO // won't be treated as a directive and won't be able to output the right code
// your code here
#endif*/

// valid multiline comments styles
/*
#if MY_MACRO
// your code here
#endif*/

/*
#if MY_MACRO
// your code here
#endif
*/

Usage

Commit count: 47

cargo fmt