PPX
Small C-style macro expansion library.
Example
let result = parse_string;
// result = "hello world, John!"
More examples in the tests folder.
Features
#param: A parameter that can be passed when including the file, or from theparse*functions.#define: Define a simple substition, or a function-like macro#include: Include another file and parse it as well. Optionally accepts parameters which will be used for substituting the names specified by#param.
Optional features:
- Macros
include_ppx!andinclude_ppx_string!: Parse a template at compile time instead of at runtime. Enable macros with featuremacroormacro-stable. vfsfeature: allows using virtual filesystem from the vfs crate as the input.
planned
#if
Development
Running tests
Or better, with the cargo-all-features subcommand:
License
MIT or Apache-2.0.