tangled
alpha
login
or
join now
tholps.site
/
skidmark
0
fork
atom
Tholp's bespoke website generator
0
fork
atom
overview
issues
pulls
pipelines
for_each_file_in_group_reverse
tholps.site
4 months ago
bf7181c6
a7662a08
+37
2 changed files
expand all
collapse all
unified
split
src
macros
for_each.rs
mod.rs
+30
src/macros/for_each.rs
···
129
129
scope,
130
130
);
131
131
}
132
132
+
133
133
+
pub fn macro_for_each_file_in_group_reverse(
134
134
+
origin_index: usize,
135
135
+
origin_line: usize,
136
136
+
proj_context: &mut Project,
137
137
+
_skid_context: &mut SkidContext,
138
138
+
args: &Vec<String>,
139
139
+
scope: &[Token],
140
140
+
) -> Vec<Token> {
141
141
+
let mut files: Vec<String> = Vec::new();
142
142
+
for g in proj_context.filegroups.iter().rev() {
143
143
+
if g.name == args[1] {
144
144
+
for f in &g.files {
145
145
+
let path = f
146
146
+
.file_input
147
147
+
.strip_prefix(&proj_context.input_folder)
148
148
+
.unwrap();
149
149
+
files.push(path.to_str().unwrap().into());
150
150
+
}
151
151
+
}
152
152
+
}
153
153
+
return for_each_base(
154
154
+
&args[0],
155
155
+
&files,
156
156
+
proj_context,
157
157
+
origin_index,
158
158
+
origin_line,
159
159
+
scope,
160
160
+
);
161
161
+
}
+7
src/macros/mod.rs
···
98
98
min_args: 2,
99
99
max_args: 2,
100
100
},
101
101
+
Macro {
102
102
+
symbol: "for_each_file_in_group_reverse",
103
103
+
expansion: macro_for_each_file_in_group_reverse,
104
104
+
takes_block: true,
105
105
+
min_args: 2,
106
106
+
max_args: 2,
107
107
+
},
101
108
];