Premium Only Content
			Compiler From Scratch: Phase 1 - Tokenizer Generator 018: Fixing errors at EndOfText, add more tests
Streamed on 2024-11-15 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
The testing from last time revealed some bugs when the text buffer ends in certain ways. Today I debugged that issue and got all 120 tests to run. It related to how we were looking for the end of the text buffer and also how the LAZY tokenizer build differed from the BATCH tokenizer build.
Once that was done I tackled a couple of loose ends. The first loose end was to parse the TokenizerRule actions out of the string and into some Boolean flags. Eventually we will add more actions the tokenizer can take, and this makes that future work a little easier.
Lastly, there were a few places in the generated code that were logging errors. This is not good. The errors (and any warnings) should be saved in the Context. So I made that change. The only tricky bit here is the TxtBuf must be declared before the Context and can't reference it directly. Rather, the Context passes in a callback for when an error needs to be reported to it.
Then we added one more test case to be run each test execution, this time looking for "unexpected character" errors. It was a simple test to implement at the end of the day.
- 	
				
							6:14
								Buddy Brown
6 hours ago $0.76 earnedLaw Enforcement Caught SNOOPING on PRIVATE LAND! | Buddy Brown
4326 - 	
				
							16:21
								Real Estate
1 month agoIt’s Not Just You..NO ONE CAN AFFORD KIDS ANYMORE
1092 - 	
				
							LIVE
								LFA TV
23 hours agoLIVE & BREAKING NEWS! | MONDAY 11/3/25
1,149 watching - 	
				
							1:11:07
								vivafrei
2 hours agoFishing for Lawsuits! I Get Blocked Because Zohran is Anti-Gay? Halloween Terror Plot & MORE!
72.1K22 - 	
				
							1:12:46
								Russell Brand
4 hours agoWE’RE BACK! The Fight for Freedom Starts NOW - SF645
68.2K66 - 	
				
							1:07:56
								The Quartering
3 hours agoBen Shapiro Vs Tucker Carlson, Blackface Trick Works, Kash Patel Under Fire, Based Woman Vs Trans
58.2K18 - 	
				
							1:35:28
								The HotSeat With Todd Spears
2 hours agoEpisode 202: Ladies it's YOUR Battle too!
3.38K7 - 	
				
							1:24:44
								DeVory Darkins
5 hours agoTrump dominates 60 minutes interview as Democrats surrender to Mamdani
116K41 - 	
				
							7:29
								China Uncensored
6 hours agoThey’re Beautiful. They’re Dangerous. They Work for the CCP.
4.13K15 - 	
				
							1:50:43
								Tucker Carlson
4 hours agoChris Williamson’s Advice to Men: How to Survive a World of OnlyFans and AI Girlfriends
68.5K73