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.
-
1:20:19
Fresh and Fit
4 hours agoThe Assassination of Yahya Sinwar. What This Means For The Future
18.5K14 -
LIVE
Right Side Broadcasting Network
1 day agoLIVE REPLAY: President Trump Holds a Rally in Latrobe, PA - 10/19/24
10,507 watching -
29:59
MYLUNCHBREAK CHANNEL PAGE
15 hours agoThe Old World, Under Our Feet?
83.2K56 -
52:56
TheTapeLibrary
17 hours ago $29.03 earnedThe Most Haunted Object in the World | The Terrifying True Story of the Dybbuk Box
72.2K8 -
30:45
World Nomac
13 hours ago$500 First Class on Amtrak's 28 Hour Texas to Chicago Route 🇺🇸
55K22 -
1:59:33
Mally_Mouse
8 hours agoLet's Hang!!
64.6K4 -
4:36:34
GamerGril
7 hours agoLFD! LOOKING FOR AN ABSTRACT DADDY! 😉 | SILENT HILL 2
46.9K5 -
5:25
BuddyBrown
2 days agoThe "Disastrous" FOX NEWS Interview! | Buddy Brown
57.7K50 -
2:34:31
Jewels Jones Live ®
1 day agoTRUMP DERANGEMENT SYNDROME | A Political Rendezvous - Ep. 96
72.3K40 -
11:29
Space Ice
11 hours agoRings Of Power Season 2 Pt. 1 - You Owe Amazon An Apology - Best Movie Ever
66.5K24