Immutable EARS requirements and extraction from text and MDC documents
Dependencies
let requirement = @ears.Requirement::Requirement(
"While enabled, when polled, the sensor shall report temperature.",
)
// requirement.pattern() == @ears.Complex
// requirement.preconditions() == ["enabled"]
// requirement.trigger() == Some(@ears.Event("polled"))
// requirement.system() == "sensor"
// requirement.response() == "report temperature."[Where <feature>,] [While <state>, ...]
[When <event>, | If <unwanted condition>, then]
the <system> shall <response>let spec = @ears.parse_text(
"The sensor shall measure.\nWhen polled, the sensor shall reply.\n",
)
let requirement = spec.requirements()[0].requirement()let spec = @ears.parse_markdown(
"---\ntitle: Sensor\n---\n- When **polled**, the sensor shall reply.\n",
)
// spec.document() retains the immutable MDC document and its frontmatter.
let document = @mdc.Document::Document("The sensor shall measure.")
let extracted = @ears.from_mdc(document)mise exec -- moon test pkgs/ears tests/ears-acceptance tests/ears-laws --target jspub enum Origin {
Text(SourceSpan)
Markdown(path~ : NodePath, span~ : SourceSpan?)
} derive(Eq, Debug)fn parse_markdown(source : String, strict? : Bool, file? : String) -> Specification raise ParseErrorInstall
Download zipImmutable EARS requirements and extraction from text and MDC documents
Dependencies