Commit Graph

15 Commits

Author SHA1 Message Date
Aadhavan Srinivasan
45827b5dd3 Allow hyphen to be escaped inside character class 2025-01-24 14:58:07 -05:00
d210a85253 Updated handling of '\b' when inside character class, made invalid
escapes an error.

The '\b' value refers to a word boundary normally, but refers to the
backspace ASCII value inside a character class. I updated
newEscapedNode() to deal with this. I also changed the behavior, so that
trying to escape any other value results in an error, instead of just
returning the character as-is.
2025-01-21 22:14:38 -05:00
7056026e10 Added a new class 'CHARCLASS', which represents a character class with some other postfixNodes in it. The 'except' field now contains a list of postfixNodes rather than runes 2025-01-19 21:43:21 -06:00
f5eb9c8218 Defined postfixNodes for LPAREN and RPAREN 2024-12-09 01:05:47 -05:00
21b2d5a2a9 Added lookaround-related fields to postfixNode struct 2024-11-22 00:12:22 -05:00
c807d6664e Changed generation of characters for non-whitespace, non-digit and non-word characters - it's basically an inverted character class now 2024-11-20 10:39:24 -05:00
e882f41400 Added fields to denote all the characters that an 'allChars' postfixNode _shouldn't_ represent (useful for inverting character classes) 2024-11-20 09:41:37 -05:00
160b2f9215 Added newline character as an escaped node 2024-11-20 01:04:01 -05:00
c56d81a335 Added unicode support to dot metacharacter - it now matches _any_ unicode character (almost) 2024-11-18 16:44:43 -05:00
9a073aa514 Added node types for left and right parentheses 2024-11-07 15:55:37 -05:00
b602295bee Added support for specifying how often a postfixNode is repeated 2024-11-03 14:36:56 -05:00
a19d409796 Set node type to ASSERTION if the character represents an assertion 2024-10-31 17:14:56 -04:00
656c506aa8 Wrote function to provide correct node for escaped character 2024-10-30 09:33:52 -04:00
b8d5ea0897 Wrote function to create a character node regardless of the contents of the node 2024-10-29 10:05:01 -04:00
444413e1f7 Added postfixNode type to represent a node in the postfix representation of the regex 2024-10-28 17:39:32 -04:00