From e6a5c20d42a8f34ff0f4a247be62fc5880e7983d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Wed, 26 Feb 2020 14:04:41 +0100 Subject: [PATCH] Add pipe character to allowed word boundaries --- src/parse/helpers.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/parse/helpers.rs b/src/parse/helpers.rs index bff2b96..c622b86 100644 --- a/src/parse/helpers.rs +++ b/src/parse/helpers.rs @@ -23,6 +23,7 @@ fn is_character_word_boundary(c: char) -> bool | '*' | '/' | '%' + | '|' => true, _ => false, } @@ -71,6 +72,7 @@ mod tests assert_eq!(word_boundary("*rest"), Ok(("*rest", ()))); assert_eq!(word_boundary("/rest"), Ok(("/rest", ()))); assert_eq!(word_boundary("%rest"), Ok(("%rest", ()))); + assert_eq!(word_boundary("|rest"), Ok(("|rest", ()))); assert!(word_boundary("0").is_err()); assert!(word_boundary("rest").is_err()); }