Tholp's bespoke website generator

forgot to run cargo fmt

Tholp1 186d52d5 da6c7a4a

Changed files
+9 -14
src
+3 -3
src/macros/mod.rs
···
-
pub mod simple_macros;
pub mod insert;
pub mod simple_blocks;
+
pub mod simple_macros;
pub mod template;
use super::types::Macro;
-
use simple_macros::{macro_clear, macro_time};
use insert::macro_insert;
use simple_blocks::{macro_comment, macro_null, macro_repeat};
+
use simple_macros::{macro_clear, macro_time};
use template::macro_template;
pub static MACRO_LIST: [Macro<'_>; 7] = [
···
Macro {
symbol: "time",
expand: macro_time,
-
has_scope:false,
+
has_scope: false,
},
// Scoped
Macro {
+4 -4
src/macros/simple_macros.rs
···
if args.len() != 1 {
let origin_file = context
-
.file_for_index(origin_index)
-
.expect("Macro 'Time' was given a bad origin index")
-
.clone();
+
.file_for_index(origin_index)
+
.expect("Macro 'Time' was given a bad origin index")
+
.clone();
println!(
"{:?}:{} ;Time only accepts 1 argument, got given {} ({:?})",
origin_file.to_str(),
···
}
return split_to_tokens(t.format(&args[0]).to_string(), origin_index);
-
}
+
}
+1 -2
src/macros/template.rs
···
let mut output = self.tokens.clone();
-
for tok in &mut output
-
{
+
for tok in &mut output {
tok.origin_file = origin_index;
}
+1 -5
src/stringtools.rs
···
break;
}
-
let mut i = 0;
-
while i < tok.chars().count() {
-
let c = tok.chars().nth(i).unwrap();
-
i += 1;
-
+
for c in tok.chars() {
if c == '\"' {
quoted = !quoted;
continue;