Convert the "inherited" field from spec into a DeclarationMetadata attribute
(inherited: &str)
| 225 | |
| 226 | /// Convert the "inherited" field from spec into a DeclarationMetadata attribute |
| 227 | fn convert_inherited(inherited: &str) -> Option<TokenStream> { |
| 228 | let normalized = inherited.replace('\n', " ").to_lowercase(); |
| 229 | match normalized.as_str() { |
| 230 | "no" => None, |
| 231 | "yes" => Some(quote! { inherits }), |
| 232 | // "n/a" means not applicable - treat as Unknown |
| 233 | "n/a" => Some(quote! { inherits = Unknown }), |
| 234 | // "no (but see prose)" means complex inheritance rules - treat as no |
| 235 | s if s.starts_with("no") && s.contains("prose") => None, |
| 236 | // Catch-all for complex cases like "see individual properties" |
| 237 | _ => { |
| 238 | eprintln!("Warning: Unknown inherits value: {}", inherited); |
| 239 | Some(quote! { inherits = Unknown }) |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | /// Convert the "percentages" field from spec into a DeclarationMetadata attribute |
| 245 | fn convert_percentages(percentages: &str) -> Option<TokenStream> { |
no test coverage detected