From 8de4bd6d732c3490a7d7a3d7433d8974b8592895 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 17 Feb 2022 21:31:42 +0530 Subject: docs: readme update --- README.md | 19 ++++++------------- TODO.md | 3 ++- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 2acdfba..f6e4054 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Whitespaces are ignored (except within literals) * `\s` => Any **string** * `\n` => Any **number** * `\b` => Any **boolean** -* `\o` => Any **object** (has to be a record) [TODO] -* `\a` => Any **array** [TODO] +* `\o` => Any **object** (has to be a record) [TODO] +* `\a` => Any **array** [TODO] * `\T` => Any **truthy** value * `\F` => Any **falsey** value * `a|b` => match `a` **or** `b` @@ -22,23 +22,16 @@ Whitespaces are ignored (except within literals) * `a+` => **One or more** consecutive instances of pattern `a` in the list * `a{2, 5}` => **Min-Max** quantifiers (example matches `a` more than 2 times but less than 5) * `(\s\T)` => **Group** (example matches any non-empty string) -* `^a$` => `^` indicates **start** of list, and `$` indicates **end** of list [TODO] +* `^a$` => `^` indicates **start** of list, and `$` indicates **end** of list [TODO] * `a,b` => match `a` on current item followed by `b` on the next item (**sequence**) * `[name \s\T]` => match **property** of object (example matches items with property `name` as non-empty string) -* `> n` | `>= n` | `< n` | `<= n` => **Comparison** with literal number [TODO] +* `> n` | `>= n` | `< n` | `<= n` => **Comparison** with literal number [TODO] * `/pat/` => Test string values against **regex** * `"foobar"` => String literal (example matches the string `foobar`) * `-2.05` => Number literal (example matches the number `-2.05`) * `true` => Boolean literal (example matches the value `true`) - - -### TODO - - [ ] `replaceAll` function - - [ ] `match` function - - [ ] Named capture groups - - [ ] Non-capturing groups - - [ ] Nested list evaluation - - [ ] Number comarison +* `(? \s\T)` => Named capture group (example matches `\s\T` pattern with the name `myMatch`) [TODO] +* `(?: \s\T)` => Non-capturing group (example checks for `\s\T` but doesn't return it as a match) [TODO] ### Examples diff --git a/TODO.md b/TODO.md index cf9bce3..ec58b00 100644 --- a/TODO.md +++ b/TODO.md @@ -5,9 +5,10 @@ - [X] Eval: Next item/Sequence - [X] Func: matchAll - [X] `{2, 5}` quantifiers + - [X] Func: replaceAll - [ ] Eval: `^$` start-end - - [ ] Func: replace - [ ] Not/Inverse - [ ] Named capture groups - [ ] Non-capture groups + - [ ] `[prop]` should match object with given property -- cgit v1.3.1