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
Barry Cunningham
6 hours agoPRESIDENT TRUMP HAS EXPOSED BARACK OBAMA AS A TRAITOR! AND MORE NEWS!
6,181 watching -
LIVE
Sarah Westall
1 hour agoThe Discipline of Remote Viewing: Shroud of Turin, Surface of Mars & the Unknown w/ Daz Smith & Team
2,372 watching -
17:37
Colion Noir
3 hours agoGavin Newsom Gifted A Gun On Shawn Ryan Podcast, Claims He's Not Anti-Gun
10.1K29 -
31:37
The Rad Factory
1 day ago $11.67 earnedTesting $300 Amazon Supercharger: Will It Blow??
35.9K13 -
22:02
Mrgunsngear
20 hours ago $10.63 earnedHeckler & Koch Full Size VP9A1 F Review: The Best Striker Fired Duty Handgun?
31.3K18 -
1:25:18
Jeff Ahern
3 hours ago $7.35 earnedThe Sunday Show with Jeff Ahern
21.3K7 -
LIVE
Spartan
4 hours agoSpartan - Pro Halo Player for OMiT | Scrims vs C9 then ranked
241 watching -
LIVE
Gore TV
6 hours ago🔥💥 MY GUN BROKE MID-FIGHT?! 🤯💣 | Division 2 Chaos with a Toy Rifle 😂🔫
174 watching -
17:14
JapaNomad - Video Tours
3 days ago $3.64 earnedNissan GT-R R35 2AM Tokyo Expressway Run | Pure Car ASMR | No Music | No Voice | 4K HDR
32.4K5 -
27:35
NordicVentures
7 days ago $2.91 earned3 Days Solo on a Island: How to Build a Simple Beach Shelter!
27.4K8