MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / lift_scope

Function lift_scope

atomic-canonical/src/lift.rs:204–213  ·  view source on GitHub ↗

Lift a `:::scope-in` / `:::scope-out` container into a `ScopeItem`. `kind` is "scope-in" or "scope-out" and drives the generated id slug. Prose body is the unconstrained narrative (never graded).

(d: &Directive, id_base: &str, kind: &str, n: usize)

Source from the content-addressed store, hash-verified

202/// `kind` is "scope-in" or "scope-out" and drives the generated id slug.
203/// Prose body is the unconstrained narrative (never graded).
204fn lift_scope(d: &Directive, id_base: &str, kind: &str, n: usize) -> ScopeItem {
205 let local =
206 d.id.clone()
207 .unwrap_or_else(|| format!("{}-{kind}-{n}", slug(id_base)));
208 ScopeItem {
209 type_: NodeType::ScopeItem.as_str().to_string(),
210 id: as_urn("scope", &local),
211 text: d.body.clone(),
212 }
213}
214
215/// Lift a `:::constraint` container into a `Constraint`.
216fn lift_constraint(d: &Directive, id_base: &str, n: usize) -> Constraint {

Callers 1

lift_intentFunction · 0.85

Calls 3

as_urnFunction · 0.85
cloneMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected