Skip to content

[stable] Macros for ultra-flexible injection of compiler trees, literals, or binary data into Rust syntax trees from external sources.

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

clucompany/include_tt

[include_tt]

(Macros for ultra-flexible injection of compiler trees, literals, or binary data into Rust syntax trees from external sources.)

Usage

Add this to your Cargo.toml:

[dependencies]
include_tt = "1.1.0"

and this to your source code:

use include_tt::inject;

Example

use include_tt::inject;
use std::fmt::Write;
fn main() {
	let mut buf = String::new();

	inject! {
		write!(
			&mut buf,
			"Welcome, {}. Your score is {}.",
			#tt("examples/name.tt"),			// `"Ferris"`
			#tt("examples/" "score" ".tt")	// `100500`
		).unwrap();
	}

	assert_eq!(buf, "Welcome, Ferris. Your score is 100500.");
}
See all

License

This project has a dual license according to (LICENSE-MIT) and (LICENSE-APACHE-2-0).

uproject  Copyright (c) 2023-2025 #UlinProject

 (Denis Kotlyarov).


Apache License

apache2  Licensed under the Apache License, Version 2.0.



MIT License

mit  Licensed under the MIT License.



About

[stable] Macros for ultra-flexible injection of compiler trees, literals, or binary data into Rust syntax trees from external sources.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages