summaryrefslogtreecommitdiff
path: root/src/steps.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-01-08 09:20:04 +0200
committerLars Wirzenius <liw@liw.fi>2020-01-08 11:41:21 +0200
commit432a88a05bec355aff948cdbfef0bacd9c57db8e (patch)
treee51cdacf6bb1b0d8bbd4d20807c706e4b3534a4c /src/steps.rs
parentfbcc54cde9a2c77dc2cfd00ce95c4d2a2eebc243 (diff)
downloadsubplot-432a88a05bec355aff948cdbfef0bacd9c57db8e.tar.gz
Change: use tera templates for generating Python code
Diffstat (limited to 'src/steps.rs')
-rw-r--r--src/steps.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/steps.rs b/src/steps.rs
index 7df6dda..66ab453 100644
--- a/src/steps.rs
+++ b/src/steps.rs
@@ -1,4 +1,5 @@
use crate::{Error, Result};
+use serde::{Deserialize, Serialize};
use std::fmt;
/// A scenario step.
@@ -10,7 +11,7 @@ use std::fmt;
/// This is just the step as it appears in the scenario in the input
/// text. It has not been matched with a binding. See MatchedStep for
/// that.
-#[derive(Clone, Debug, Eq, PartialEq)]
+#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct ScenarioStep {
kind: StepKind,
text: String,
@@ -69,7 +70,7 @@ impl fmt::Display for ScenarioStep {
/// 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)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub enum StepKind {
/// A "given some precondition" step.
Given,