diff options
Diffstat (limited to 'src/bindings.rs')
-rw-r--r-- | src/bindings.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bindings.rs b/src/bindings.rs index 8c33cc4..8e3531b 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -49,6 +49,10 @@ pub enum CaptureType { /// for one of the embedded files in the document, otherwise codegen will /// refuse to run. File, + + /// Paths are sequences of non-whitespace characters which will be interpreted + /// as a file-path (e.g. PathBuf) or similar when processed by a step + Path, } impl FromStr for CaptureType { @@ -62,6 +66,7 @@ impl FromStr for CaptureType { "uint" => Ok(Self::Uint), "number" => Ok(Self::Number), "file" => Ok(Self::File), + "path" => Ok(Self::Path), _ => Err(SubplotError::UnknownTypeInBinding(value.to_string())), } } @@ -77,6 +82,7 @@ impl CaptureType { Self::Uint => "uint", Self::Number => "number", Self::File => "file", + Self::Path => "path", } } @@ -89,6 +95,7 @@ impl CaptureType { Self::Uint => r"\d+", Self::Number => r"-?\d+(\.\d+)?", Self::File => r"\S+", + Self::Path => r"\S+", } } } @@ -787,6 +794,7 @@ lazy_static! { CaptureType::Uint, CaptureType::Number, CaptureType::File, + CaptureType::Path, ]).iter().copied() { // This Unwrap is okay because we shouldn't have any bugs in the // regular expressions here, and if we did, it'd be bad for everyone |