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
Steven Crowder
2 hours ago🔴 The Lies are Sick: Charlie Kirk's Legacy Separating Fact from Fiction
86,332 watching -
LIVE
The Rubin Report
58 minutes agoListen to the Fear in Whoopi Goldberg’s Voice on 'The View' as She Gives a Chilling Warning
2,665 watching -
LIVE
Benny Johnson
1 hour agoKash Patel Testifying LIVE Now on Charlie Kirk Assassination, Trump to Declare Antifa TERRORISTS?!
6,811 watching -
2:07:38
Timcast
2 hours ago🚨LIVE: Kash Patel Testifies Over Charlie Kirk Assassination In Senate | Tim Pool
30.1K28 -
1:01:35
VINCE
2 hours agoThe Left's 'Malignant' Violence Problem | Episode 126 - 09/16/25
191K59 -
LIVE
LFA TV
5 hours agoLFA TV ALL DAY STREAM - TUESDAY 9/16/25
4,712 watching -
1:45:59
Dear America
3 hours agoKiller ADMITS To Killing Charlie In DISCORD. Terror Cell EXPOSED! + JD Fills In on Charlie’s Show!
148K81 -
LIVE
Wendy Bell Radio
6 hours agoThe Left Lives In A Bubble
7,055 watching -
LIVE
Barry Cunningham
2 hours agoLIVE BREAKING NEWS: KASH PATEL HEARING!
1,623 watching -
LIVE
House Committee on Energy and Commerce
1 hour agoAppliance And Building Policies: Restoring The American Dream Of Home Ownership And Consumer Choice
46 watching