Premium Only Content
			Compiler From Scratch: Phase 1 - Tokenizer Generator 012: Debugging NFA to DFA conversion
Streamed on 2024-10-04 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
Short stream.
Last time we were blocked from testing the newline functionality in the tokenizer because the newline characters weren't in the DFA correctly. There was a token effort to debug the issue, but I didn't get very far at the end of the last stream. Which brings us to today where I got serious about the issue. With lots of debugging print statements I found the issue where in the NFA to DFA conversion process. The problem was that when a state was being added to the closure it was already marked as "visited" and its children were then not being processed on the next time through the loop. A quick test and clearing that flag fixed the main issue.
While the DFA was looking better, the pattern for the newline character didn't look right. I changed the newline pattern from "([\n\r]|(\r\n))" to "(\n|(\r\n?))" and was much happier about the results. Those changes let us finally test the newline function in the tokenizer. The tokens are getting the right line numbers now. I tried to trim the newline characters off the end of the line as tracked by TxtBuf, but didn't have time to finish that off.
I also did a quick test of the string regex pattern, but didn't have time to dig in, although I have some ideas to check. So I left off with a couple of loose ends due to the shortness of the stream that we'll pick up next week.
- 	
				
							21:38
								Professor Nez
19 hours agoTrump JUST BROKE the INTERNET with SAVAGE Line on Ilhan Omar!
31K26 - 	
				
							1:17:52
								Dialogue works
3 days ago $6.24 earnedMartin Armstrong: This Is How World War III Starts… And It Already Has
17.4K13 - 	
				
							38:16
								daniellesmithab
3 days agoAlberta Update: Getting Kids Back to the Classroom
13.7K9 - 	
				
							20:48
								BlaireWhite
5 days agoTrans TikTokers Are Crashing Out (Over Nothing)
13.7K5 - 	
				
							2:07:06
								Side Scrollers Podcast
20 hours agoHasan Piker CAUGHT LYING AGAIN + Twitch URGES LEFTIST IDEOLOGY + More | Side Scrollers
61.1K10 - 	
				
							8:40
								MattMorseTV
16 hours ago $8.19 earnedSchumer just KICKED OFF the Left-Wing CIVIL WAR.
16.3K28 - 	
				
							21:39
								Nikko Ortiz
2 days agoI Take A North Korean Shooting
21.1K5 - 	
				
							1:46:26
								The Michelle Moore Show
19 hours ago'The Religion Invasion In the U.S. and the Deep State Agenda' Guest, Mark Taylor: The Michelle Moore Show (Nov 3, 2025)
26.5K33 - 	
				
							LIVE
								TruthStream with Joe and Scott
5 days agoSovereign Codes & Cosmic Infrastructure,Ufo's, UAP's, Monads, Matrix Satellites, Interstellar Visitors, SYRONA #505
398 watching - 	
				
							LIVE
								Lofi Girl
2 years agoSynthwave Radio 🌌 - beats to chill/game to
148 watching