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