Skip to content

Transforms text or TokenStream using Rust's macro_rules syntax.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

frozenlib/macro-rules-rt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macro-rules-rt

Crates.io Docs.rs Actions Status

macro-rules-rt is a crate that transforms Rust source code using the syntax used in macro_rules.

Example

use macro_rules_rt::Rule;

let from = "$e:literal".parse()?;
let to = "$e * 5".parse()?;
let rule = Rule::new(from, to)?;
let source = "1 + 2";
let expect = "1 * 5 + 2 * 5";
let result = rule.replace_all(source)?;
assert_eq!(result, expect);

License

This project is dual licensed under Apache-2.0/MIT. See the two LICENSE-* files for details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Transforms text or TokenStream using Rust's macro_rules syntax.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages