summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-05-21 17:42:54 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-05-24 13:26:33 +0100
commitfdb7c6716ebb31bfac2d174cbd3adbedd57eca99 (patch)
tree0179f91eef5165aa7e9625c9cfd8cc88b3111eb2
parente71417588253f066976944f019a8a9b6021bdc36 (diff)
downloadsubplot-fdb7c6716ebb31bfac2d174cbd3adbedd57eca99.tar.gz
errors: Add error case for regex metacharacters detected
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--src/error.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 53128b2..60c850e 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -10,6 +10,14 @@ pub enum SubplotError {
#[error("simple pattern contains a stray {{ or }}")]
StrayBraceInSimplePattern(String),
+ /// The simple pattern has regex metacharacters.
+ ///
+ /// Simple patterns are not permitted to have regex metacharacters in them
+ /// unless the pattern is explicitly marked `regex: false` to indicate that
+ /// the binding author understands what they're up to.
+ #[error("simple pattern contains regex metacharacters: {0}")]
+ SimplePatternHasMetaCharacters(String),
+
/// Scenario step does not match a known binding
///
/// This may be due to the binding missing entirely, or that the