SkylerLipthay / string_to_expr

Compile-time expression evaluation for strings in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

string_to_expr

Compile-time expression evaluation for strings. Inspired by trws. Check tests/tests.rs for examples.

I found this technique to be necessary to concatenate identifiers in macros. Really handy for generating structs, enums, and functions. One day, Rust will probably be able to parse macros with more flexibility. Until then, I'm using this crazy mess.

About

Compile-time expression evaluation for strings in Rust

License:MIT License


Languages

Language:Rust 100.0%