1a2f1b7ca9Restructured code into 'cmd' module with CLI and 'greg' module with regex library; export necessary struct fields and methodsAadhavan Srinivasan2025-01-30 08:56:03 -05:00
46f4a2ad83Return error instead of panicking if the range cannot be processedAadhavan Srinivasan2025-01-29 14:30:16 -05:00
833dd269a8Added more descriptive comments; throw error if non-greedy operator is used; use new definition for kleene()Aadhavan Srinivasan2025-01-29 10:28:18 -05:00
ecab7cc522Make kleene() throw an error if the state is not quantifiableAadhavan Srinivasan2025-01-29 10:27:54 -05:00
8b6d35c106Finished adding tests from Python's test suite; removed a non-greedy operator from one of the old testsAadhavan Srinivasan2025-01-29 10:27:03 -05:00
bde153ce08Changed '-t' flag to include the new RE_SINGLE_LINE flag as wellAadhavan Srinivasan2025-01-28 16:52:50 -05:00
4c3c7e21c5Fixed inverted Perl classes inside character classes eg. '[\D]'; added new flag for 'single-line' mode, where dot metacharacter matches newlinesAadhavan Srinivasan2025-01-28 16:52:28 -05:00
d029a171c0Changed behavior of SOS and EOS assertions depending on whether multiline mode is enabled or notAadhavan Srinivasan2025-01-28 15:51:48 -05:00
7cd24959bfAdded case-insensitive tests (copied the normal tests, added the case-insensitive flag and swapped the case of all characters in the test stringAadhavan Srinivasan2025-01-28 12:39:04 -05:00
6e309be71cMoved case-insensitive stuff to thompson(); fixed case-insensitivity in character classes and rangesAadhavan Srinivasan2025-01-28 12:34:36 -05:00
c92b3d0e7cRemoved case-insensitive functionality from shuntingYard(); should be put in thompson() insteadAadhavan Srinivasan2025-01-28 12:12:37 -05:00
94c8044eb7Running all tests case-insensitive with the same match indices wasn't a good ideaAadhavan Srinivasan2025-01-28 11:42:53 -05:00
4a45d1c95eallCases() now takes a boolean parameter that indicates whether we are case-sensitive or notAadhavan Srinivasan2025-01-28 11:41:51 -05:00
4547ba74f0Throw error if a quantifier is quantified eg. 'a**'; throw error if start of character range is greater than the end eg. '[b-a]'Aadhavan Srinivasan2025-01-28 09:40:19 -05:00
125590d334Replaced literal brackets with LBRACKET and RBRACKET metacharactersAadhavan Srinivasan2025-01-28 09:15:10 -05:00
20142e93c4Removed some panics with error throwing; changed some comments; removed use of mustPop() in parsing Kleene star - I use pop() and then throw an error if pop() returns an errorAadhavan Srinivasan2025-01-28 08:30:36 -05:00
1db61108e4Allow pipes that have a missing operand - if an operand is missing, it is replaced with a zeroLengthMatchState(), which always has a zero-length matchAadhavan Srinivasan2025-01-25 22:36:58 -05:00
1520edad55Enforce the rule that character classes must have at least one character; interpret literal closing brackets as regular charactersAadhavan Srinivasan2025-01-24 15:50:36 -05:00
6fb266e0d2Refactored isNormalChar(), wrote function to get special characters that have metachar replacementsAadhavan Srinivasan2025-01-24 15:49:33 -05:00
649485f01dRemoved character range creation from the first part of shuntingYard() (the part that adds concatenation operators), because octal and hex values haven't yet been deciphered at this point in the codeAadhavan Srinivasan2025-01-22 16:51:00 -05:00
25cb79f01bChanged the value of EPSILON, so that we can use the NUL character (which it used to be) in a regex; Also added code to detect escaped backslashesAadhavan Srinivasan2025-01-21 22:10:07 -05:00
0fb78abf7fAdded function to replace an element in a slice given its valueAadhavan Srinivasan2025-01-21 22:09:41 -05:00
47ec95f7bbCreated function that returns a 'default' stateRockingcool2025-01-19 21:45:07 -06:00
a14ab81697Updated function names, addeed new function 'FindString' that returns the _text_ of the matchRockingcool2025-01-19 21:44:15 -06:00
7056026e10Added 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 runesRockingcool2025-01-19 21:43:21 -06:00
b81a2f8452Added functions to find if a character is a valid hex value and a valid octal valueRockingcool2025-01-19 21:31:18 -06:00
fcdb4a8868Added another test, changed function calls to match new namesRockingcool2025-01-19 21:30:56 -06:00
3a3333b38aNew features, changed character class behaviorRockingcool2025-01-19 21:26:56 -06:00
4376ccb77dRenamed function calls to use new namesRockingcool2025-01-19 21:22:33 -06:00
3f0360b9beFixed bug where I used the 'lookaroundNumCaptureGroups' member of the wrong State structRockingcool2025-01-09 10:39:04 -06:00
0956dddd81Fixed bug where I checked if flag was enabled before calling flag.Parse()Rockingcool2025-01-09 10:38:35 -06:00
0b84806fc4Added 'flags' to the Compile function, instead of maintaining global state to check whether certain features were enabledRockingcool2025-01-09 10:33:56 -06:00
24fa365be1Moved some auxiliary functions into compile.go; use new API for compiling and finding matchesRockingcool2025-01-06 20:14:57 -06:00
1da3f7f0e0Changed API for match-finding functions - take in a Reg instead of start state and numGroups separatelyRockingcool2025-01-06 20:14:19 -06:00
8e8067482aRewrote to use new API for compiling and finding matchesRockingcool2025-01-06 20:12:18 -06:00