1853 Commits

Author SHA1 Message Date
b52b5ff28c parse wildcard . character for NFA too 2025-09-30 14:05:39 +01:00
5fa784b4c6 refactor nfa.sml so that lists in CONCAT and ALTERNATION cases don't need the state to be tupled with the regex 2025-09-30 13:52:35 +01:00
45fbd85183 move buffer around when calling 'SearchList.buildRange' 2025-09-30 05:40:57 +01:00
e03eecf940 use LineGap.sub instead of LineGap.substring, as the former function is now fixed 2025-09-30 05:30:11 +01:00
265e6e1a90 fix bugs in 'LineGap.subRight' (we were not passing nextIdx in recursion properly) 2025-09-30 05:23:31 +01:00
b35d045a09 fix bugs in implementation for 'Nfa.getMatchesInRange' 2025-09-29 22:57:19 +01:00
14bb447289 fix known errors in LineGap.sub function 2025-09-29 22:29:28 +01:00
863b4ba47b do not require pattern matching head when in subRight/subLeft loop, but only require that in some cases 2025-09-29 22:13:03 +01:00
6de33a65c2 fix minor type error introduced in line_gap.sml in last commit (was returning an integer instead of a char) 2025-09-29 22:03:36 +01:00
f4422cc36c add function to line_gap.sml to retrieve a single specific char 2025-09-29 21:56:39 +01:00
d37e510b24 progress fixing backtracking 2025-09-29 21:29:03 +01:00
64c16a7c25 fix bug with shadowing 'finishIdx' value, when we still wanted access to both the previous and the new 'finishIdx' 2025-09-29 21:21:06 +01:00
df78e20cb7 fix bug in 'Nfa.getMatches' loop function: when we find that this state is valid, continue loop from 'finishIdx + 1'. 2025-09-29 21:07:02 +01:00
665497cf46 fix all remaining type errors 2025-09-29 15:06:33 +01:00
fd321c2f14 fix some type errors 2025-09-29 15:02:40 +01:00
8f49cdca13 fix type errors in normal-mode-text-builder.sml 2025-09-29 14:55:20 +01:00
d44799a794 fix some type errors in the code 2025-09-29 14:49:50 +01:00
8ba16daf7a add function to persistent-vector.sml to check if we are in a specific range 2025-09-29 14:29:43 +01:00
13ccdbb202 return PersistentVector.t when building search-list/executing nfa, because we don't want to use a simple flat vector for the search list now 2025-09-29 14:02:07 +01:00
6d2b43606f when parsing a string into an NFA, return an option type if the syntax is invalid 2025-09-29 13:34:55 +01:00
7dc94632d6 fix backtracking bug in 'Nfa.getMatchesInRange' (we were passing the wrong value instead of 'strIdx' in the recursive call to the loop function) 2025-09-29 13:13:14 +01:00
b6720ed5f1 first pass of 'get matches in range from nfa' functionality 2025-09-29 12:18:45 +01:00
8d29bfab78 adjust nfa to return all matches in string, instead of just testing for one match and then returning true 2025-09-29 10:28:03 +01:00
f52a8306ea add comments to ongiong NFA implementation 2025-09-29 08:33:10 +01:00
6b7485f753 change NFA interpreter slightly so that, if we see that a match is invalid at some place, we check in the next place to see if it is valid later in the string 2025-09-29 02:00:04 +01:00
f8b707de20 interpret concatenation and alternation in nfa 2025-09-29 01:45:28 +01:00
e01712a065 progress interpreting alternation in nfa 2025-09-29 01:06:15 +01:00
d9720c5643 begin adding interpretation for NFA 2025-09-29 00:46:05 +01:00
d75b1a18ff flatten repeated concatenations and alternations into a single list when possible 2025-09-28 22:23:48 +01:00
032ca56bbf add initial implementation of compiling a regex string to an NFA 2025-09-28 22:01:44 +01:00
64678bf68e add tests for 'dE' motion 2025-09-27 15:40:26 +01:00
5234338e25 small change similar to previous commit: in search-list.sml's 'backtrackFull' function, always check if the position is at the correct string before checking if we are at the place where the search should continue 2025-09-27 14:47:24 +01:00
d01a1367ae add test for 'dw' case: when we use 'dw' on last word in buffer, and there is no newline after last word, we delete last word fully 2025-09-27 13:09:18 +01:00
d9380bcb64 pass regression test by modifying 'SearchList.backtrackRange' function. The modification that worked was swapping two if-statements around: first we check if the string position is 0 (and loop to check the previous string if so); in the else case, we check if the searchPos <= 1 (which signals for us to exit backtracking). Swapping the order of the if-statements means that, when we exit the loop, we always exit with string that is at this position. 2025-09-27 12:40:28 +01:00
39db9c652e add new test where we receive an exception when deleting while there is a search 2025-09-27 12:31:29 +01:00
0b490b00bb add tests for 'de' motion 2025-09-27 10:02:05 +01:00
8ad5cc77c3 change colour of text in search bar as well 2025-09-27 08:35:52 +01:00
5e9872e4d6 better visual positioning for cursor 2025-09-27 08:14:22 +01:00
2c388899ca use different colours for program 2025-09-27 08:00:21 +01:00
cd31bdd0d5 add tests for 'dW' motion, which are same as tests for 'dw' motion but testing for WORD instead of word where possible 2025-09-27 07:14:26 +01:00
074ba2bcde done adding tests for 'dw' motion 2025-09-26 08:21:54 +01:00
5e1e66a977 add another test for 'dw' motion 2025-09-26 07:58:23 +01:00
88a1489a54 pass failing test case for 'dw'. When we delete to the end of the file and the position the cursor was previously at no longer exists, move cursor to last valid character in file. 2025-09-26 07:46:42 +01:00
9e0f62d142 add another test for 'dw' motion when deleting in the second of three words (this one passes) 2025-09-26 07:32:35 +01:00
5503b8ebda add failing test for 'dw' motion 2025-09-26 05:27:48 +01:00
b31d7650a8 change the way we calculate the newCursorIdx when we delete using the 'dk' motion while on the last line. We go to the buffer's last line and find the first column. This more directly expresses what we want and now passes the failing unit test for 'dk'. 2025-09-25 14:59:29 +01:00
05abecc70d pass a failing test for 'dk' motion by decrementing newCursorLineNumber if the end of the deletion range is on a newline, and it is also the last char in the buffer 2025-09-25 14:44:39 +01:00
1494d5c356 add two new unit tests for 'dk' motion 2025-09-25 13:58:56 +01:00
6b0149162f a bit of formatting 2025-09-25 10:50:02 +01:00
bf55373f6d fix 'MakeNormalDelete.deleteLineBack' test, which failed because we were using the wrong way to check if cursor is currently at the start of the line. We checked '(endOfLine = cursorIdx) which works in most cases to verify that the current position is a newline, but fails when the cursor is at the last non-newline character of the line. This is fixed by being more precise and calling 'Cursor.isCursorAtStartOfLine' to check directly if the cursor is currently at the end of the line. 2025-09-25 10:49:20 +01:00