| 182 | /// synthesizer keeps its JS sweep. |
| 183 | #[napi] |
| 184 | pub fn cfnptr_scan_files(files: Vec<CfnptrFileIn>) -> Vec<CfnptrFacts> { |
| 185 | files |
| 186 | .into_iter() |
| 187 | .map(|f| { |
| 188 | let structs: Vec<cfnptr::StructExtent> = f |
| 189 | .structs |
| 190 | .into_iter() |
| 191 | .map(|s| cfnptr::StructExtent { id: s.id, start_line: s.start_line, end_line: s.end_line }) |
| 192 | .collect(); |
| 193 | let facts = cfnptr::scan_file(&f.text, &structs); |
| 194 | CfnptrFacts { |
| 195 | fn_ptr_typedefs: facts.fn_ptr_typedefs, |
| 196 | fn_type_typedefs: facts.fn_type_typedefs, |
| 197 | structs: facts |
| 198 | .structs |
| 199 | .into_iter() |
| 200 | .map(|s| CfnptrStructOut { |
| 201 | id: s.id, |
| 202 | parsed: s.parsed, |
| 203 | fields: s |
| 204 | .fields |
| 205 | .into_iter() |
| 206 | .map(|fl| CfnptrField { name: fl.name, index: fl.index, ptr: fl.ptr, ty: fl.ty }) |
| 207 | .collect(), |
| 208 | }) |
| 209 | .collect(), |
| 210 | inline_ptr: facts.inline_ptr, |
| 211 | inline_types: facts.inline_types, |
| 212 | inline_tags: facts.inline_tags, |
| 213 | init_tokens: facts.init_tokens, |
| 214 | array_elems: facts.array_elems, |
| 215 | alias_names: facts.alias_names, |
| 216 | d_pairs: facts.d_pairs, |
| 217 | dispatch_fields: facts.dispatch_fields, |
| 218 | array_dispatch_names: facts.array_dispatch_names, |
| 219 | includes: facts.includes, |
| 220 | } |
| 221 | }) |
| 222 | .collect() |
| 223 | } |
| 224 | |
| 225 | /// Debug/differential hook: the native `stripCommentsForRegex(text, 'c')`. |
| 226 | /// Exists so the strip differential oracle can pin the Rust stripper against |