You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Aadhavan Srinivasan
360bdc8e11
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 | |
---|---|---|
.gitignore | 2 months ago | |
Makefile | 2 months ago | |
go.mod | 2 months ago | |
go.sum | 2 months ago | |
main.go | 2 months ago | |
matching.go | 2 months ago | |
misc.go | 2 months ago | |
nfa.go | 2 months ago | |
postfixNode.go | 2 months ago | |
re_test.go | 2 months ago | |
sliceQueue.go | 2 months ago | |
stateContents.go | 2 months ago | |
todo.txt | 2 months ago |