From 22cefdc8ad79b0483da62d031ce5c1a731f60b82 Mon Sep 17 00:00:00 2001 From: Richard Carson Date: Sun, 1 May 2022 00:59:03 -0400 Subject: [PATCH] Update version number --- CHANGELOG | 6 ++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 4 ++++ src/functions/str.rs | 8 ++++++++ src/lib.rs | 2 +- 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2710aa5..3d4b80a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +0.6.0 +----- +Added (Implied)(Multiplication) 2x, etc +Overhaul of functions to enable the help commands +Add regex matching function + 0.5.3 ----- Make errors more useful diff --git a/Cargo.lock b/Cargo.lock index 580fd8d..2674369 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -518,7 +518,7 @@ dependencies = [ [[package]] name = "lavendeux-parser" -version = "0.5.3" +version = "0.6.0" dependencies = [ "chrono", "derive_more", diff --git a/Cargo.toml b/Cargo.toml index 9e47749..a7fa27b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ categories = ["parser-implementations", "development-tools", "command-line-utili homepage = "https://rscarson.github.io/Lavendeux/" repository = "https://github.com/rscarson/lavendeux-parser" readme = "readme.md" -version = "0.5.3" +version = "0.6.0" edition = "2021" [features] diff --git a/README.md b/README.md index 130e0e2..c6f7226 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,10 @@ help("strlen") // Get help for a specific function by name concat("s1", "s2", ...) | strlen("string") | substr("string", start, [length]) uppercase("s1") | lowercase("S1") | trim(" s1 ") +// Regular expressions +regex("foo.*", "foobar") // foobar +regex("foo(.*)", "foobar", 1) // bar + // Rounding functions ceil(n) | floor(n) | round(n, precision) diff --git a/src/functions/str.rs b/src/functions/str.rs index 02a5f20..372c360 100644 --- a/src/functions/str.rs +++ b/src/functions/str.rs @@ -154,6 +154,14 @@ mod test_builtin_functions { Value::String("foo(.*)".to_string()), Value::String("foobar".to_string()), Value::Integer(1) ]).unwrap()); + assert_eq!(Value::String("foobar".to_string()), (REGEX.handler)(®EX, &[ + Value::String("foo(.*)".to_string()), Value::String("foobar".to_string()), + Value::Integer(0) + ]).unwrap()); + assert_eq!(Value::Boolean(false), (REGEX.handler)(®EX, &[ + Value::String("foo(.*)".to_string()), Value::String("foobar".to_string()), + Value::Integer(6) + ]).unwrap()); } #[test] diff --git a/src/lib.rs b/src/lib.rs index 56cd222..7be90f6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -102,7 +102,7 @@ //! } //! ``` //! Extensions give a more flexible way of adding functionality at runtime. Extensions are written in javascript. -#![doc(html_root_url = "https://docs.rs/lavendeux-parser/0.5.3")] +#![doc(html_root_url = "https://docs.rs/lavendeux-parser/0.6.0")] #![warn(missing_docs)] #![warn(rustdoc::missing_doc_code_examples)]