pub fn parse_license_expression(license: &str) -> BTreeSet<String>Expand description
extracts individual license IDs from an SPDX expression.
parses the expression and returns all license IDs found, including
LicenseRef- identifiers. if parsing fails, returns the original
string as a single-element set.
ยงExample
use sbom_model::parse_license_expression;
let ids = parse_license_expression("MIT OR Apache-2.0");
assert!(ids.contains("MIT"));
assert!(ids.contains("Apache-2.0"));
let ids = parse_license_expression("LicenseRef-proprietary AND Apache-2.0");
assert!(ids.contains("LicenseRef-proprietary"));
assert!(ids.contains("Apache-2.0"));