Crates.io | macroscript |
lib.rs | macroscript |
version | 0.6.0 |
source | src |
created_at | 2024-07-05 06:22:30.524015 |
updated_at | 2024-07-05 16:01:30.187033 |
description | A reimplementation of my macroscript programming language. |
homepage | |
repository | https://github.com/balt-dev/macroscript |
max_upload_size | |
id | 1292407 |
size | 73,276 |
This is a full reimplementation of Robot Is Chill's macro-based programming language.
A few things have been changed between RIC's implementation and this one. The most notable ones include:
double: [multiply/$1/2]
) aren't included by default
TextMacro
.use macroscript::{apply_macros, add_stdlib};
use std::collections::HashMap;
fn main() {
let mut macros = HashMap::new();
add_stdlib(&mut macros);
let input = "[add/5/3]".to_string();
let result = apply_macros(input, ¯os).unwrap();
assert_eq!(result, "8");
}