Lift a `:::constraint` container into a `Constraint`.
(d: &Directive, id_base: &str, n: usize)
| 269 | |
| 270 | /// Lift a `:::constraint` container into a `Constraint`. |
| 271 | fn lift_constraint(d: &Directive, id_base: &str, n: usize) -> Constraint { |
| 272 | let local = |
| 273 | d.id.clone() |
| 274 | .unwrap_or_else(|| format!("{}-constraint-{n}", slug(id_base))); |
| 275 | Constraint { |
| 276 | type_: NodeType::Constraint.as_str().to_string(), |
| 277 | id: as_urn("constraint", &local), |
| 278 | text: d.body.clone(), |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | /// Lift a `:::ref{to= edge=}` leaf into a typed reference edge. Both `to` and |
| 283 | /// `edge` are required (a ref with no target or no edge type is a lift error), |
no test coverage detected