130 Commits (21b2d5a2a92da2b78e9e95db34cf26c82d3aee16)
 

Author SHA1 Message Date
Aadhavan Srinivasan 360bdc8e11 Big rewrite - assertion handling, zero-match fixes, change in recursive calls
I added support for transitions. I wrote a function to determine if
a given state has transitions for a character at a given point in the
string. This helps me check if the current state has an assertion, and
take actions based on that.

I also fixed zero-length matching (almost, see todo.txt). It works for
nearly all cases I could think of, although I still need to write more
tests. I wrote a function to check if zero-length matches are possible
with a given state.

I also changed the way recursive calls work. Rather than passing a
modified string, the function stores the location in the input string.
This location is updated with each call to the function.

Finally, the function now increments the offset by 1 instead of
incrementing by the length of the longest match. This leads to a bit of
overhead eg. if a regex matches index 1-5, then 1-5, 2-5, 3-5, 4-5 are
all stored. To fix this, I wrote (and used) a function to check if
a match overlaps with any matches in a slice.
2 months ago
Aadhavan Srinivasan 8dbecde3ae Added support for detecting assertion characters; changed input so that newline isn't required 2 months ago
Aadhavan Srinivasan a752491563 Added more test cases 2 months ago
Aadhavan Srinivasan 656c506aa8 Wrote function to provide correct node for escaped character 2 months ago
Aadhavan Srinivasan 1bafdcdb7e Added support for inverted matches; moved escape character detection to its own function 2 months ago
Aadhavan Srinivasan 5f4a6c5a3b Added constants for LBRACKET and RBRACKET 2 months ago
Aadhavan Srinivasan e6c607319c Added more tests 2 months ago
Aadhavan Srinivasan 8e8e9e133f Fixed matching greediness eg. a(a|b)*a would not match 'aaa' in 'aaab' 2 months ago
Aadhavan Srinivasan a619fd24f6 Added map and reduce functions, and a function to return the difference between two sets 2 months ago
Aadhavan Srinivasan f8ee1b3200 Added more tests 2 months ago
Aadhavan Srinivasan a66e8f1c08 Concatenate every character if it is escaped 2 months ago
Aadhavan Srinivasan d8299294ed Added test cases 2 months ago
Aadhavan Srinivasan 45d348e7f4 Updated TODO 2 months ago
Aadhavan Srinivasan 7b815343f4 Removed exclamation mark in inverted metacharacters - had the opposite effect becasue of the way deleteFunc works 2 months ago
Aadhavan Srinivasan 1a7fd12569 Added support for some escaped metacharacters 2 months ago
Aadhavan Srinivasan b8d5ea0897 Wrote function to create a character node regardless of the contents of the node 2 months ago
Aadhavan Srinivasan 445a7247f8 Defined variables to provide ranges of characters for metacharacters 2 months ago
Aadhavan Srinivasan ca945c7740 Added support for character ranges and dot metacharacter 2 months ago
Aadhavan Srinivasan 2af4a5f9fd Added more tests 2 months ago
Aadhavan Srinivasan 76157af2b8 Wrote function to generate rune slice representing valid dot metacharacter values 2 months ago
Aadhavan Srinivasan 96b3009c14 Updated TODO 2 months ago
Aadhavan Srinivasan 444413e1f7 Added postfixNode type to represent a node in the postfix representation of the regex 2 months ago
Aadhavan Srinivasan 74c6a2e195 Added more functions to stateContents type, removed append because I don't think I need it 2 months ago
Aadhavan Srinivasan 49b84c5728 Added test cases 2 months ago
Aadhavan Srinivasan 3778869567 Use stateContents type to allow a state to store multiple characters 2 months ago
Aadhavan Srinivasan 4f2f14212c Use contains function, since the content may have multiple characters 2 months ago
Aadhavan Srinivasan 11073759e3 Added support for character classes (not ranges, yet); also take input from stdin instead of cmdline arg 2 months ago
Aadhavan Srinivasan cd680371fb Added function allEqual - checks if all given values are equal 2 months ago
Aadhavan Srinivasan df6efcd1f0 Unique append to match indices (ensure match indices aren't repeated 2 months ago
Aadhavan Srinivasan 704bec122a Added more tests 2 months ago
Aadhavan Srinivasan 3a7373bb2b Started working on new type to represent state contents 2 months ago
Aadhavan Srinivasan fe5c94b4df Use new unique append to check if unique states have been added to tempStates 2 months ago
Aadhavan Srinivasan 3984c54080 Added more test cases 2 months ago
Aadhavan Srinivasan 84c768fd5e Fixed small bug with question mark operator, wasn't adding the empty state's output 2 months ago
Aadhavan Srinivasan aee24644e9 Use new unique_append function signature 2 months ago
Aadhavan Srinivasan aee04cd8fe unique_append now returns the number of unique elements appended 2 months ago
Aadhavan Srinivasan ac2320b7ea Updated TODO 2 months ago
Aadhavan Srinivasan 7286e07858 Added question mark operator - 0 or 1 2 months ago
Aadhavan Srinivasan 13a57a4347 Stricter check for adding zero-length match at end of string 2 months ago
Aadhavan Srinivasan 4a30977d15 Added test cases 2 months ago
Aadhavan Srinivasan 89a43c8f41 Added test case 2 months ago
Aadhavan Srinivasan ae219f763a Added alternate function, removed relevant code from main; also started working on escape characters 2 months ago
Aadhavan Srinivasan cda0dfb0cc Match empty string if start state is kleene star 2 months ago
Aadhavan Srinivasan 7e7e75903d Added more tests 2 months ago
Aadhavan Srinivasan 95654e3e34 Take all possible 0-states (until no more left to take) before checking if we are in an acceptable position 2 months ago
Aadhavan Srinivasan b92912f7e4 Added test 2 months ago
Aadhavan Srinivasan 4781b87b90 Added comments 2 months ago
Aadhavan Srinivasan bf3060b672 Used 'unique append' to ensure that a transition can only contain a given state once 2 months ago
Aadhavan Srinivasan 50e86b5db4 Added 'unique append' function, to ensure that elements in slice are unique 2 months ago
Aadhavan Srinivasan b1e2d7147e Added tests 2 months ago