Premium Only Content

Compiler From Scratch: Phase 1 - Tokenizer Generator 013: Line tracking TxtBuf, fixing ANY in regex
Streamed on 2024-10-11 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
Last week I fixed the newline issue on the regex side, but the TxtBuf wasn't tracking the lines correctly at the end of that session; So that's what I started with today. It needed to trim the trailing whitespace, there was an off-by-one error with that, there was some special handling around the last line of the file and a small update to handle empty lines. With that working, the line tracking works great and we can now print out lines of text and underline the token in that context.
After that it was back to tackling the string regex. I was mostly sure that it had to do with the regex ANY operator. But as I was working through that issue, I was depressed by how bad the outputs were that I had to look at ... inconsistent, incomplete, and difficult to escape when embedding the text. So I backed up to an old TechDebt item on the TODO list and went to town on it. It took a bit of doing, but the output on the console and in the NFA/DFA graphs are now consistent and much more readable with proper escaping.
With better output to look at it was time to dig into the string regex. I identified the issue with the empty exclusion (ANY regex operator ".") and had to patch around that a bit in a few places. Ultimately it wasn't too bad to get the NFA and DFA generating correctly. The code generation doesn't work with these updates yet, but that is a problem to be solved next week.
-
LIVE
MattMorseTV
1 hour ago $1.46 earned🔴The Dems. just lost 4.5 MILLION voters.🔴
14,072 watching -
LIVE
Barry Cunningham
1 hour agoREACTING TO STEPHEN MILLER | KASH PATEL | TULSI GABBARD INTERVIEWS AND MORE NEWS!
1,806 watching -
1:04:10
BonginoReport
3 hours agoCornhusker Clink & A Sizzling Border Wall Deter Illegals - Nightly Scroll w/ Hayley Caronia (Ep.116)
68.7K38 -
6:44:51
Dr Disrespect
8 hours ago🔴LIVE - DR DISRESPECT - IMPOSSIBLE 5 CHICKEN DINNER CHALLENGE - FEAT. VISS
91.2K15 -
LIVE
The Jimmy Dore Show
2 hours agoTrump Administration Sends Accused Pedo BACK TO ISRAEL! Ukrainians Now OVERWHELMINGLY Oppose War!
9,596 watching -
1:09:21
TheCrucible
3 hours agoThe Extravaganza! Ep. 24 (8/20/25)
56K7 -
1:18:42
Kim Iversen
3 hours agoUFO Base Area 51 Catches Fire… Is It a Massive Cover-Up?!
29.5K48 -
1:51:18
Redacted News
4 hours ago"There will be consequences!!!" Trump issues big threat to Putin ahead of peace summit | Redacted
97.8K79 -
53:14
Candace Show Podcast
4 hours agoThe MOST MORAL Blackmail In The World | Candace EP 231
51.4K133 -
1:11:28
vivafrei
5 hours agoMatt Taibbi Getting "Westfalled"? Kathy Hochul Fighting for Illegals! Mamdani Minority Report & MORE
98.2K57