Commit Graph

15 Commits

Author SHA1 Message Date
cca8c7cda2 Got rid of transitions parameter, changed how kleene state is processed
I replaced the transition parameter for nfaState, replacing it with a
single nfaState pointer. This is because any non-alternation state will
only have one next state, so the map was just added complexity.

I changed alternation processing - instead of having their own dedicated
fields, they just use the new 'next' parameter, and another one called
'splitState'.

I also changed the kleene state processing to remove the unecessary
empty state in the right-side alternation (it actually messed up my
matching).
2025-02-05 22:20:28 -05:00
e0253dfaf3 Change kleene() to an alternation-style construct 2025-02-04 14:09:04 -05:00
de0d7345a8 Store left and right branches of alternation separately 2025-02-03 21:59:05 -05:00
1fd48ae614 Store the current string pointer as a 'thread variable' (allows us to simulate backtracking) 2025-02-03 16:49:10 -05:00
ad0f7d0178 Added new state fields to tell if a state is a question or alternation 2025-02-03 14:05:53 -05:00
b129d83c3f Added function to reset threads 2025-02-02 12:43:40 -05:00
8eda5055ff Replaced call to 'FindAllMatches' with call to 'FindAll' or 'FindAllSubmatch' depending on whether I need submatches 2025-01-31 09:55:36 -05:00
ee51e39d59 Added support for start-of-input (\A) and end-of-input (\Z) assertions 2025-01-30 13:56:56 -05:00
7e792f1248 Renamed more constants to avoid exporting 2025-01-30 10:44:34 -05:00
7aee4280cc Renamed 'EPSILON' to 'epsilon' to avoid exporting 2025-01-30 10:36:10 -05:00
93474c5159 Renamed 'state' to 'nfaState' because 'state' by itself means nothing 2025-01-30 10:31:02 -05:00
d81b2ddaaa Renamed 'State' to 'state' to avoid exposing the insides of the engine 2025-01-30 10:27:56 -05:00
429d286439 Renamed variable to avoid conflicting with type name 2025-01-30 10:26:31 -05:00
289bba35e2 Updated assertion constants so that they aren't exported 2025-01-30 10:18:18 -05:00
aef8152fc1 Renamed package 'greg' to 'regex' 2025-01-30 09:15:29 -05:00