summaryrefslogtreecommitdiff
path: root/src/steps.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-10-26 20:39:40 +0300
committerLars Wirzenius <liw@liw.fi>2019-10-26 20:39:40 +0300
commite525acb60f91eb8778863a19b70aecf1d23d606a (patch)
tree03d0a113d6387ad319320c65f9a6007245bd4c28 /src/steps.rs
parentf8133d4c23cd1941fda6a790ef27883c55722fac (diff)
downloadsubplot-e525acb60f91eb8778863a19b70aecf1d23d606a.tar.gz
Add: docstrings
Diffstat (limited to 'src/steps.rs')
-rw-r--r--src/steps.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/steps.rs b/src/steps.rs
index dbdabe6..ca9a75c 100644
--- a/src/steps.rs
+++ b/src/steps.rs
@@ -1,4 +1,11 @@
/// A parsed scenario step.
+///
+/// The scenario parser creates these kinds of data structures to
+/// represent the parsed scenario step. The step consits of a kind
+/// (expressed as a StepKind), and the text of the step.
+///
+/// This is just the step as it appears in the scenario in the input
+/// text. It has not been matched with a binding. See Match for that.
#[derive(Debug, Eq, PartialEq)]
pub struct ScenarioStep {
kind: StepKind,
@@ -22,7 +29,11 @@ impl ScenarioStep {
}
}
-/// The kind of step we have.
+/// The kind of scenario step we have: given, when, or then.
+///
+/// This needs to be extended if the Subplot language gets extended with other
+/// kinds of steps. However, note that the scenario parser will hide aliases,
+/// such as "and" to mean the same kind as the previous step.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum StepKind {
Given,