Generates code for a single spec by processing all its versions Accumulates properties from all spec versions, with later versions overwriting earlier ones for properties with the same name, then generates a single Rust module containing all the property definitions.
( client: &reqwest::Client, name: &str, versions: &[usize], verbose: bool, property_descriptions: &PropertyDescriptions, csswg_sha: Option<&str>, )
| 71 | /// earlier ones for properties with the same name, then generates a single Rust |
| 72 | /// module containing all the property definitions. |
| 73 | async fn generate_single_spec( |
| 74 | client: &reqwest::Client, |
| 75 | name: &str, |
| 76 | versions: &[usize], |
| 77 | verbose: bool, |
| 78 | property_descriptions: &PropertyDescriptions, |
| 79 | csswg_sha: Option<&str>, |
| 80 | ) -> Result<()> { |
| 81 | let (properties, latest_version) = collect_properties_from_versions(client, name, versions).await?; |
| 82 | |
| 83 | if properties.is_empty() { |
| 84 | println!(" No properties found across all versions"); |
| 85 | return Ok(()); |
| 86 | } |
| 87 | |
| 88 | println!(" Total unique properties across all versions: {}", properties.len()); |
| 89 | |
| 90 | let code = generate_spec_module(name, latest_version, &properties, None, None, property_descriptions, csswg_sha); |
| 91 | let line_count = code.lines().count(); |
| 92 | |
| 93 | if verbose { |
| 94 | show_verbose_output(&properties, &code, line_count); |
| 95 | } |
| 96 | |
| 97 | write_spec_module(name, &code)?; |
| 98 | |
| 99 | Ok(()) |
| 100 | } |
| 101 | |
| 102 | /// Collects and merges properties from all versions of a spec |
| 103 | /// |
no test coverage detected