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.
-
1:01:16
Timcast
4 hours agoTrump TROLLS Legacy Media, Announces WARRIOR DIVIDEND, Venezuela Fake Out
178K71 -
1:04:30
Sean Unpaved
3 hours agoSeahawks Looking For REVENGE Against Rams! | UNPAVED
15.8K -
46:32
The Amber May Show
6 hours ago $1.66 earnedLaw & Disorder: FBI Shakeups, Arrest Waves, and a Culture That’s Gone Off the Rails
26.4K1 -
12:52
The Kevin Trudeau Show Limitless
1 day agoBeyond Good And Bad: The Hidden Reality Code
20.2K10 -
1:25:01
Misfits Mania
1 day ago $10.48 earnedMISFITS MANIA: Press Conference
45.3K10 -
1:31:26
Graham Allen
4 hours agoLive From AMFEST 2025: Day 1
66.5K13 -
1:56:43
Steven Crowder
7 hours agoLWC Christmas Special 2025 | Giving Back with Santa Crowder
286K166 -
14:33
Robbi On The Record
5 hours ago $3.50 earnedNPC Girls & The Digital Dehumanization of Women
53.5K11 -
53:25
Simply Bitcoin
1 day ago $2.93 earnedThe Bitcoin Crucible w/ Alex Stanczyk & Tomer Strolight - Episode 13
42.3K1 -
59:21
The Rubin Report
5 hours agoIs This the Real Reason Bongino Is Leaving the FBI?
66.6K84