Lift a `:::constraint` container into a `Constraint`.
(d: &Directive, id_base: &str, n: usize)
| 334 | |
| 335 | /// Lift a `:::constraint` container into a `Constraint`. |
| 336 | fn lift_constraint(d: &Directive, id_base: &str, n: usize) -> Constraint { |
| 337 | let local = |
| 338 | d.id.clone() |
| 339 | .unwrap_or_else(|| format!("{}-constraint-{n}", slug(id_base))); |
| 340 | Constraint { |
| 341 | type_: NodeType::Constraint.as_str().to_string(), |
| 342 | id: as_urn("constraint", &local), |
| 343 | text: d.body.clone(), |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | /// Lift a `:::ref{to= edge=}` leaf into a typed reference edge. Both `to` and |
| 348 | /// `edge` are required (a ref with no target or no edge type is a lift error), |
no test coverage detected