Benjamin’s 188-day commitment demonstrates the rare discipline needed to master the foundational complexities of systems programming. This systematic approach to compiler logic proves that deep technical expertise is a product of consistent, incremental rigor.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
studying compilers every day until i land a compiler role (day 188)Added:
And we're live. Um, for the first time I'm actually early.
Um, yeah, there's there's no logical reason behind it, but yeah. Uh, this is day 188, uh, studying compilers every day until I land a compiler role.
The lighting in my room is a mess, but that's fine. Um, last time we continued doing more uh, preprocessor stuff. Um, specifically we started writing some actions for uh, I guess the two directives that we're supporting.
Um, this time we're going to continue doing that. Um, there's like these three things that we wanted to get done, so I think that's what we're going to work on.
Um, yeah, it's it's going to be a good time.
Um, also, one thing that I noticed while I was setting up for today's stream, our branch is called runtime, which isn't really accurate anymore. It's like runtime and preprocessor. So, get hub rename branch.
Is there a place to do this on GitHub?
Oh, there is. Nice.
Um, okay, how do we do this?
So, view all branches, and then like rename. Oh, nice.
Uh, runtime or I guess we could do Yeah, what do we call this?
Um, hm.
Let's call this preprocessor dash runtime.
Or runtime dash preprocessor, I guess.
That seems accurate.
Uh, we'll yank that.
Uh, did that close a PR at all?
Okay, yeah, that's fine.
And let's throw all of that here.
Okay, nice.
Um, do do do. Let's make this a thing.
Actually, can we just copy Can we yank all this or uh, hm.
And this GitHub thing is kind of annoying.
What happens if I just make this like that?
Okay, I just need to yank things now.
Uh, this is done.
Uh, let's yank this as well.
Real.
Okay.
So, that's that's going to be our start.
Um, yeah, now we can close out of all of that and we can actually start writing code.
Um, since I'm done worrying about that.
So, let's see.
So, we're on the preprocessor.
We wanted to deal with like this thing.
And then like this whole slashes well.
Um, but there's there's one big thing that we haven't done, which is just like adding the lines. So, we should do that real quick.
Um, so it should be res push back. Or I guess like can we just like plus equals line? Like that maybe?
I guess we can do that. That's nice.
Um, it should have a new line on it, so I'm happy with that.
Um, okay, let's make build.
Uh, what else is here as well?
Wait, so include should also have until end. Okay, yeah, so that's fine.
Uh, and then can we just build and panic test regression input? Let's give it preprocess.
Okay, that's fine.
Or wait, is that fine?
Oh, yeah, yeah, that's fine.
Dash E, that's what we need to do.
Okay.
At day 188, I think compilers are studying you. I mean, I I would be very concerned if the software was able to start studying me, but if if it does, then that would be I don't know, that's not the worst outcome, I feel like.
Like there's there's already a lot of stuff that is studying, for better or for worse.
Um, yeah, okay.
So, we can do this.
And then if we look at this, oh, it's empty.
Wait, that's odd.
Um, hm.
Oh, this needs to be a ref maybe?
Is that what needs That might actually be it.
That might need to be what happens.
Uh, rebuild. Do you apply to any roles at Intel? Um, I'm currently not recruiting because I have an internship for this upcoming summer, but once full-time roles for 2026 or 2027, sorry, uh, full-time roles for 2027 start, I think that's when I'm going to start looking again properly.
Hey, okay, we got we got code.
We we got sorted code.
Okay.
Um, yeah, okay. So, now hm.
Yeah, I guess this is going to be kind of ugly regardless, so we're just going to we're just going to do our best here.
Um, let's commit this real quick.
Uh, so what do we do here?
Uh, generate output for preprocessor.
Uh, and then what happens if we dash E with like something else?
It's like op.c.
Yeah, like this is fine.
Uh, we might have to like trim some We might have to add back some white space like that, but that's that's a future issue.
Actually, we could do that now.
Um, hm.
Line should match that, right?
Right?
Or what do we Oh, we're matching body, I see.
Oh, okay, yeah, so then it isn't necessarily eating the white space.
Um, maybe we should add that to body.
Or at least we should we should change the way we read the line.
Um, okay, so let's let's change this cuz I want to preserve that white space in a way.
So, we want pactol S or or actually we could just steal this.
We can do that and then we can replace directive with white space comma directive like that.
And then we can take all of that.
We can paste that there.
Okay, so now this should vomit out things correctly.
Or at least preserving the white space in some capacity.
Um, where is cat?
I guess we just we amended it, right?
Yeah, okay, so this preserves all that.
Um, so we can get diff op.
op.c and then test regression input op.c no diff. Okay.
Um, let's just amend it instead.
Okay.
Uh, okay, now now we get to have fun again.
Did you make a W move by specializing in something early?
Um, I just agree. I think I guess like in some sense it was very much just like random luck that I found something that I found interesting.
Um, but I don't necessarily think that it's like very much an advantage. Like there is also a lot of other really cool stuff in computer science, and I could very much see a world where I like ended up going into like machine learning.
Um or like OS for instance. I prob- hell, I probably could have been happier doing OS. Um but Um I don't know. I haven't given it like too much thought. Maybe it's better to keep it that way, but yeah. The the bottom line is like computer science is just such a broad field that I think like there is a certain joy in just like going through everything and learning about it for the first time. And I guess I still have been doing a bit of that, but at least a lot of my work has I've kind of like I don't know. I guess like in a sense I've kind of type casted myself already for better or for worse.
Um yeah, there's there's tradeoffs to the choice as always. Every choice has tradeoffs. So I wouldn't really like assign too too much value to it.
Um okay, let's let's figure out the include directive.
Um Hm.
Yeah, so we can do that.
Let's see what the path or at least like the default search path is. Is that So um Okay, so these are fall- I guess this is like the fallback for quoted.
So first we check the same directory as the file, then we check directories of currently opened include files in reverse or Oh my god.
Wow, that's that is a mess.
Wow, I I actually didn't know that was a thing. That's crazy.
Wow.
Uh let's go and drizzle.
Directories of the currently opened include file.
Wait.
What does this mean?
Specializing I I guess like I guess I see what you're saying, but I don't know. I don't I personally wouldn't assign it as much weight as you are in this instant.
Like there's there's just like a lot of factors in general, and yeah.
Um okay, let's let's see.
What is the include environment variable anyway?
All right, let's check here.
Huh, okay.
Can you help us get employed? I'm I don't know how much I can do on that front unfortunately.
I also kind of have to find permanent employment for myself as well. So Yeah.
Uh include environment variable for stu- Okay, I see.
Um Microsoft specific.
Okay, wait. Why am I Why am I looking there?
Uh search rules maybe.
Maybe this will help more.
I don't understand what is meant by quote directories.
Help you somehow? Um I mean I don't really know what you could do to help me either.
Um you're like you're like free to like Hm.
Actually, there is one thing. Um if you wanted to write tests because I I am bad at writing comprehensive tests.
Um join my Discord. There's a nice little uh there's a nice little uh submit a test forum, and it should it should be like public postable. So if you want to make a post here with a test um all the instructions are like listed out here.
So yeah, that is probably the best way to directly contribute, I think.
Um okay, I'm going to I'm going to look at it for a second. I need to I need to figure out how this works.
Um so what is meant by like quote directories? Surely I can like LLM this.
I What's good, Aiden? I just like basic science requirements. That's so real.
It's like I don't know. Like you like uh Like none of the classes are like particularly enjoyable. So >> [laughter] >> Yeah.
Uh what was I going to look up? Let's Let's pull up Claude.
Yeah, let's Claude this out.
Uh explain the places that pre- C preprocessor looks when resolving an include.
Maybe the biggest waste of my time?
Yeah, I think actually eh I don't know. I think I think there is like some value in some of it. Um maybe we shouldn't necessarily like require a CS major to take like fizz or chem, but like yeah, there's like there's just like there's definitely worse, I feel like.
Um okay.
Let's Let's take a look at this.
Um Huh.
This looks wrong.
Uh let's go Google it.
This has been This is very confusing for me because I don't think I've gotten a straight answer on how include is resolved.
Almost no value in cramming gen ed the night before. That's fair actually.
I guess like you could say the same about like some humanities classes though in a sense.
And it's like up to you like how interesting stuff is. So Oh, this is actually pretty helpful.
Uh okay, let's do Wait. What? Wait, that's a thing?
Wait, hold up.
Oh, wow.
Is this just Wait, what?
What is What is this?
Huh.
Okay, well that's That's interesting.
Okay, um let's or wait, this is in this thing.
Okay.
Wow.
So much stuff to look at.
Um Oh, wow.
Huh.
So include include include.
So this is just GCC. Okay.
Um Wow.
Okay, well um I don't know what to do with this is the problem.
Huh.
Ah, man. This is This is actually like really annoying just because of like how unhelpful a lot of stuff is to like figure this out.
Um Oh, man.
>> [sighs and gasps] >> I guess we have the file path. So yeah, we have the file path here.
Um What do we do with this then?
We guess we could do like Oh, no. We can't make a global here though. Cuz it actually changes every time we call pre-process.
Cuz we might have to like nest pre-processes.
Ah, that's really annoying.
Maybe we can make these like stacks or something.
Actually, yeah. How what order is this parsed?
So, if we have a file but Wait. What?
Okay, wait. No, this makes sense. This Ah, wait. We have to do like multiple passes on this though if we want to do it correctly, I think.
I think we need to resolve all includes first.
Right.
Do we need to? Wait. Okay, I'm confusing myself.
Let's look at Godbolt.
Can we like define foo one like that?
And then let's do So, if we do foo here then that obviously works.
But if we do foo up here like int I equals foo that should fail.
Okay.
Okay, so then we can just top down this, I think.
Right.
We should be fine just to like read it in line by line and then parse.
Um so, then we just need to like keep parsed clauses global, I think. Or define map global.
Parsed clauses I think should stay global.
Um the only problem now is figuring out like file path.
Um So, how do we store state for this at least? That That gives me headache.
Cuz the problem is once we When we try to parse an include, that might cause problems.
Um Hm.
Ah.
Hm.
Man.
Why is this so dark in your room? Is it night? Um it's like the evening, yeah.
I mean, there's a clock in the background. Actually, there's just a clock in my tmux, I think. Yeah.
Ah.
Hm.
Yeah, I actually don't I actually don't know how to I don't know how to go about searching. I think we can just like I don't think we need like additional logic. I think we just need to figure out like where we look for a file.
Um so, it searches for a file named that.
Um What is meant by quote directories here?
I guess it's distinct.
Okay. Well, um oh man.
Is there a way to like pass in the current directory?
Or like take the current directory? I guess there should be cuz we definitely use it in the engine somewhere.
And by engine, I mean driver, compiler, whatever.
Um What is Okay, wait.
Oh, wait. We can just dot stem it. Okay, yeah.
Um Or I guess we could just make a file, right?
Hm.
Let's Let's try it out.
So, let's go to include directive.
So, let's just like ah Yeah. So, let's let's like enumerate this out more clearly.
Uh search current directory and then Yeah, so we want to check the current directory.
And then we want to check quote directories.
Or wait, containing current file.
Um Hm, wait.
No, this is confusing now.
I guess we have the path. I guess current file directory.
And then we want to check quote directories. So, I think that is just a separate set of directories.
Like that.
Um Yeah, we can do that.
Okay, and now here we need to figure out what else happens.
So, just standard system directories.
I guess.
Um okay. Well, this is going to be fun. Uh current file should be the easiest one to do because I know what that is. Or at least I can get that very easily.
Um hm.
We should probably have a way to handle what the current the current directory is. I think we just make a stack and call it a day.
Um Yeah.
Or can we just store in a temp var? I guess it's no different than a stack.
Let's just make a vector.
Um current file, I guess. We can call it that.
Okay. So, we can do um current file push back input file.
Can I make this const?
No, I cannot do that.
This is fine.
Um Yeah, let's do that. And then we can do pop back here.
Yeah, okay. Let's continue.
Um Or unless we Do we want to make this a path instead actually?
Um or stood file system or a stood file system path. I think we we use it here.
Yeah, we have file system.
So, this This is going to be This is going to be fun.
Um We definitely do some stuff with it here.
So, you do path um input or cur file, I guess.
Or how do we make this again? I think we did like dash I.
Or wait, no. We did this. We can just do the We can just use the string.
Or can we even just cast it like this?
Is this a thing?
Why is that a thing? That's really funny.
Yeah, okay. We can do that then. That's very cursed, but it works.
Oh, man.
Um Man.
Okay.
Where do we Where do we go from here?
Yeah, okay. So, we have the current file and then we just like pop it off the stack and life is good.
So, now we need to actually handle the thing.
Oh, man. Replacing Replacing defines is going to be rough.
I might actually like ask Claude if there's a better way to do it algorithmically.
Um unless I want to like unless I want to do like grep or like some sort of hand-rolled grep implementation.
Actually, that's just kind of a leak code problem now that I think about it.
Um anyways, so we want we want uh uh let's do current file back, I think.
Oh, the best thing is you leave now. Uh take care, GroovyR. Thanks for Thanks for stopping by.
Uh this is a ref.
Type is this?
Hmm.
I think this should be fine. I don't know if this stays a ref.
Maybe if I think we need to do that as to keep it as a ref.
Yeah, okay. This is fine then.
So, this is a copy.
So, then or can we stem, maybe? I think a stem Is stem what we want?
Uh we don't want stem.
Parent path, I think, is what we want though.
Um So, we do that plus Oh, man.
Um let's add path like that.
Or wait.
Does that work? Maybe we need the slash operator? Oh my god, that works.
Wait, that's so stupid.
Uh we'll find out if this works.
Right? Let's Let's see what happens.
I'm very scared, actually, of what's going to happen.
Um okay.
Include putter Oh, that actually worked.
That worked perfectly.
Okay.
Let's close that.
Um Yeah, so we can do that. And or can we Is there like a replace file name, actually?
And then let's replace it with path like that instead.
And then what was Okay, file.
And then Okay, that's good.
Um Yeah, so we can do that.
Okay, so that should be correct. And then I guess curder file, I guess we'll call it. I don't know what to call this.
Um Wait, what is Okay, let's look this up.
C++ file or file system path.
So, um why is this font so ugly?
Um Hmm.
So, what can we do with this?
Man.
Um Is there an exists function?
C++ file system path check if exists.
Oh, stood file system exists? Okay.
Okay. Fair You know what? Fair enough.
Um file system exists.
Uh curder file.
Um Let's Let's just rename this.
Newder.
Or no, we can't call it that.
New file.
I guess like Uh naming things is so hard.
Um okay, let's uh file name.
Let's do that.
We'll just call this file.
What's wrong here? Oh.
We need to change that. Uh what's good, Ahmed?
Oh, man. Okay.
>> [sighs] >> So, then if it exists, then I guess we could we could actually just we could do this without braces. So, pactol Can we just do this even?
Do in and then res.
Right? Or actually, we could give it another s- we can make another string buffer.
Right?
Right? And then this Oh.
Um okay, we can't do that cuz that will overwrite it.
Um instead of in, we should give it Let's make Let's just make a lambda, actually. That might be the easiest way to do this.
Um so, we need file name anyways.
So, let's make Let's make a lambda, which is um include file, I guess.
Or we could just call it include.
So, let's make a lambda.
Let's give it stood file system file.
Um We can make this a ref, I think.
What's wrong here?
Our path.
We can do that.
Uh we're going to need to do something with this.
Uh okay, so we want to do Oh, man.
Uh so new file equals er file contents.
I guess.
Let's do that.
And we parse and we give it um file.
Or wait, no. We need to Oh, man.
Wait, we just We just do We just call preprocess on it. What am I doing?
Yeah, we can that is just call preprocess.
Um so, we can do uh res plus equals preprocess.
And then we give it uh we give it file.
Let's go.
There we go. That's That's what we needed.
Can't believe I almost wrote a almost wrote a lambda for that. That would have been That would have been silly.
Um I guess we Yeah, this is This formatting is fine.
Uh this to do we will leave there for now.
Um Standard system directories scares me a little bit.
Let's just try to build it and see what happens. Let's see if this even works cuz I think there might be some like template shenanigans.
Um Let's cat preprocess.
Oh, wait, it worked. Wait, it actually worked. That's insane.
Wait, I'm I'm actually quite happy with that.
Okay.
Um What if we just don't implement that?
>> [sighs] >> We'll just We'll just leave these as to-dos for now.
Uh what's good, Azrif? Uh did you write the test yourself or did you grab them from somewhere? Um I have been writing them myself.
Um but well, it's it's hard to write tests. And when I write tests, they usually don't really cover a lot.
Um I I already promoted this today, but I don't think it hurts for me to I don't think it hurts for me to promote it again. Um on my Discord, there's this uh which you should join, by the way.
Join the Discord. It's linked in the description.
Um there's this like forum. I don't know what this is called this type of channel is called, but it's like a forum.
Um Yeah, so if you want to help me write tests and get credited somewhere in my um uh and get credited somewhere in my codebase, um this would be the place to do so. There's a couple rules here, but just like make a post with a test, um and I will I will prob- I'll use it if I um if I deem that it is a good test, and you you will be you'll be immortalized in my codebase somewhere.
Um yeah, anyways, enough enough promotion.
Um I need to Wait.
Let me check something. Oh, I'll check my Riot client later. Um Three of my friends queued into each other in Valorant, and they had they had the game of the century, and I do not know how it went.
It's going to browse your ears. Oh.
Yeah, I um if you wanted to like look at proper tests for C What is wrong here? Oh, we don't use iostream anymore.
Um yeah, if you wanted to look at like proper tests for C, um or if you like needed them for something, um C Smith is a thing.
It generates C programs. It's pretty crazy.
Um there's like a list of bugs that it's found, I believe, somewhere.
Uh bugs reported.
And this this goes for quite a while, so yeah.
It's It's pretty cool.
Um okay, let's let's commit some stuff.
Add that.
Uh handle first level of quotes include.
Okay, so then hm, system directories.
C preprocessor standard system directories.
Um system headers?
Dash I system, sure.
I guess we could just like hardcode a vector.
And then like if if we wanted to add the I dash I flag or dash I system, um we could just like append it onto that list.
That might be smart. That might be scalable.
Um hm.
Okay.
Yeah, so that didn't help me at all.
Let's look here.
What if I just steal print print search directories? What if I just like What if I just get that?
Hm.
Ah, this is really annoying.
All right, let's ah sorry.
Sorry for the flashbang.
Um is there anything useful here?
What are the predefined macros? We could add some of these.
Hm.
It would be really funny if I just wrapped date with like the system macro for date, for instance, or all of these. It would be like really stupid, and I should not do that, but like yeah.
Um Oh, we want to skip comments. Oh.
I see.
Um I guess it doesn't matter if we skip comments.
Yeah, cuz they're they're comments. It doesn't affect the output, I guess.
Okay, let's let's see if there's anything useful here.
Um Well, that doesn't help me.
Hm.
Okay, we're just not going to We're just not going to worry about this for now.
Uh let's let's continue chugging along.
We can leave the to-dos there.
Um defined macros are a little bit scary, though. Um I need to figure out how I want to replace those.
Um cuz we have a set uh I guess we want to replace all instances of I guess it's just like really slow to traverse the hash map every time. This is like n squared.
I hope there's a better way to do this.
Ah, I guess there's not.
Let's see.
Sequentially, that's fine.
Definition body is appended to the front of the remaining input.
Wait, what?
Wait, huh?
Oh, I see. Interesting.
Wow.
Wait, what?
The definition body is appended to the front of the remaining input.
Ah.
Wait, what?
Oh, wait, I guess that makes sense. I forgot to I forgot that you can nest macros like that.
Wow, that's really annoying.
Wow.
Okay, well, we'll implement that later.
Um yeah.
That's That's going to be fun.
I guess undef should be easy.
Concatenation.
Yeah, sure, That makes sense.
Okay. Well, this is this is scary.
Um C preprocessor include define macro.
I guess we we know how it works, I think.
So, how do we how do we do this find and replace in the lines at least?
Um Hmm.
Actually, does the C preprocessor remove comments?
This is a good question.
Bro.
Replaced with a single space. Okay.
That makes sense.
Okay.
I guess we should probably look into this more explicitly.
Wow.
Hmm.
Interesting. Okay. There's there's a lot of a lot of mess that goes into this.
Uh I don't I don't want to worry about that yet. So, we're actually just going to like save it for later.
Um Yeah.
The problem is that also means I don't really know what I want to do for the rest of today's stream.
Um We've kind of like gotten one big thing done.
I I'm going to take a I'm going to take a crack at this, I think. We're just going to do this the slow way.
Um Yeah, actually, how do we want to do that?
Um Hmm.
Cuz look, the order of application matters here then, right?
I guess we don't want to like double replace something yet.
Hmm.
Yeah, this really sucks. This does really suck.
Um Hmm.
Yeah, C preprocessor implementation.
Uh okay. Macro expansion guide. Oh my god.
Okay, let's try to let's try to read this.
Da da da.
So, define object 1 2 3.
So, we we're given this program.
So, da da da, scan sequence between directives.
Da da da.
Skip white space, sure.
Um okay, we can do that.
Okay, so then this is an identifier.
Blue paint.
So, it's a macro name.
I see.
Wow. Wait.
Hmm.
Wow, this is this is very complex, actually.
Um We might have to We might have to handle this differently then.
Um instead of that, we might have to do like Oh, man.
Okay, let's look at Pectol again.
Uh we might have to just like go token by token and then do replacement on the token.
I think that's like the less awful way to do it, though. So, that should be fine.
Um da da da, where do we go?
Performance notes.
Minimize backtracking, sure.
The at rule.
Okay.
Uh rule reference. This is what we want.
Um combinators, maybe?
Uh Hmm.
Is there a good way to do this? We could probably do list.
So, non-empty list of R separated by S.
Where each S can be padded by P. What?
Oh, actually, this makes sense. I see.
Um how do I build a type checker?
Um I don't have a good answer to that, unfortunately.
It It depends a lot on your type system and it depends on like I guess how much work you want to put into it.
If you have just like some static typing, I think you can kind of just go off of variable names. If you have like gradual typing or like some sort of dynamic typing, I think that makes more of a mess.
Oh, man.
So, what is rep?
I guess we want Where was it? I think we want list then, right?
Yeah, I guess we want list.
Is there an optional list?
I guess this is fine.
Right, we can we can just wrap it with optional.
Um I guess if we're already like reading in a white space, right?
Oh, man.
Okay, let's do Let's do struct line or body white space of some sort. And then we can do struct body I guess token.
Okay, so then we need to Oh, man.
So, we can do list and then list list and then or we want sequence of Oh, man.
Um What is Pectol until again? I think we could just use until for this.
Yeah.
So, we match sequence of S as long as R doesn't match.
So, we can do sequence of We can do body token. I guess we could do Hmm.
peck tool until We can do another until inside.
And this needs to be until as well.
And then we can do body white space or can we just do white I guess we want to keep the white space.
Uh is there a way to just like replace a token?
Um well, okay.
Oh man.
Uh Uh this is awful.
>> [laughter] >> This is really awful.
Cuz we need to like map actions on it.
Is this even remotely reasonable?
Okay, so then let's just let's make this peck tool until We can make it until peck tool white space or Hmm, until white space or I guess peck tool blank.
Yeah, this makes sense.
Yeah, this has to have at least one white space. So we can just like So we can do that.
And then And then we or I guess we want white space first, right?
Uh wait, no. No, that doesn't make sense.
>> [sighs] >> Um Yeah, this is very annoying.
Let's Okay, let's do it um Let's invert this.
And then let's make the white space optional.
No, wait. We can't do that.
How do we account for like trailing white space and prepended white space?
Uh what's good Virats? I'm just finding your channel. I'm a sophomore CS student trying to make sense of all of my courses. Currently in Washington, this has been a huge inspiration to lock in.
Thank you. Um Yeah, I mean the job market is always going to like look a little bit rough.
Um I think Yeah, it's it's very easy to like very lazily go through your classes and just like like cloud code it out. Um But I think as long as you put in the time and uh you put in the time in your classes, you you learn as much as you can and uh you I guess um you like polish up your resume with like projects and maybe like research if your institution has that.
Um I think you'll be in a good spot regardless.
So, yeah. Just keep at it. Um it's scary, but you will get there.
Um Man, this is this is pretty difficult.
Uh let's look at the undercover. Um I've been stuck on a project for over 2 weeks. Today I gave up and I used AI.
Um I think that's fine. Like it's not like it's not like AI is going to go away. So like I think it's I think it's reasonable to at least use it in some capacity.
Um as long as you're not like becoming completely dependent on it, I think uh I think you should be fine.
Um Or as long as like you're being like conscious {slash} mindful of it.
Uh yeah, of course. Um I I will I will end up getting through this regardless. Um I appreciate the support lots.
Um okay, so the reason we have body white space here. So this should just be white space. Um the reason we're preserving this is because we want to we want to add it back. So Yeah, we need an action for this specifically, but it do- it should not match white space.
Um this is a little bit scary though.
I don't know how to I don't know how to do this.
I guess we could peck tool until white space just to be clear with this.
Yeah, we could do that.
Okay, so how do we how do we do this?
Um Okay, new plan.
Let's do Let's start with an optional white space. And then we Hmm.
Wait, no. That doesn't work either. What the hell?
Um Okay, let's >> [sighs] >> Oh man.
Let's do a sequence. Okay, let's let's just start this from scratch.
We'll worry about the contents later.
So then some sort of body of some sort here. I'm just making up something.
Um so the body will Yeah, so we can do Actually, we could just Uh I'm getting frazzled.
Let's just use a list. Let's just use the damn list. Oh my god.
Or is just like an alternating Is there an alternating pattern that isn't like strictly list?
Or I guess that also pads, right?
Oh, wait. Yeah, we can just do that.
Wait, that's really nice.
Um >> [sighs] >> Okay, we could do list tail probably.
Yeah, let's actually do that. Let's do list tail.
So let's take this. Lit uh peck tool list tail or Uh Okay, wait.
What if we match on the white space?
That is a terrible idea. We should not we should not match on the white space actually.
Uh let's let's start with the the simple way.
peck tool sequence of Oh, no. This is going to get unwieldy.
Uh so we have body token.
Or we want body white space.
body token And then tail is body white space and that is optional.
So we that accounts for trailing white space.
The way we account for prepended white space is with the sequence that we match starting with white space.
And then Oh, this doesn't work.
Oh.
Okay, we're going to need to figure out token a little bit differently.
Um we'll we'll worry about that in a second.
Um the way we should resolve this is peck tool optional white space.
Because if there's a if there are two tokens next to each other, they will be treated as one token, I guess.
Or I guess we want to like we want to distinguish it anyways.
So we're going to fix this, I think.
Um Yeah, I don't know what to do with this.
Um I guess we could do Hmm.
Okay, let's Ah, [sighs] okay.
>> [laughter] >> Um >> [sighs] >> None.
Okay, we definitely want the until white space. That is like the definitive end of a token.
In some capacity.
I don't know why I'm encoding it like this. This is like really stupid. I should not do it like this, but it's fine.
So, let's let's until pectol blank.
Then, what do we do with this?
So, we want There are a couple different things.
So, we can or ASCII rules. This is what we care about.
Um So, we do pectol identifier.
So, it can be an identifier.
Or it can be Ah, I don't want I don't want to do this.
How How does it split?
Is there like a symbol?
Ah.
Hmm.
This is not fun.
I guess this Wait.
Um Wait. Wait. Wait. Wait. Wait. Wait.
So, an identifier is just an identifier.
Which is nice.
So, we can just like we can just parse by identifier and then like do nothing with everything that's not an identifier, actually. That might be That might be the easiest way to do this.
Um Okay, let's let's start over.
Let's do identifier and then not identifier.
Um okay, let's let's replace this not.
This is so scuffed.
This is going to be one of those things that I work on now and like 5 months down the line, I'm going to look at it and I'm going to be like, "What the hell was I thinking?"
Cuz truly, what am I thinking right now?
Um okay, let's Let's do something with that in a second.
Um So, not identifier simple. We can do pectol until uh pectol identifier first.
So, every We just keep going until we hit the first character of an identifier.
And then this we can just do pectol identifier.
Like that.
This is so stupid. What the hell am I doing?
And then this should still match body, I think, right?
I really hope this works. It'd be so funny if this worked.
Yeah, so we still match body.
Please work. Oh, no.
Oh, no.
Yeah, that's that's not readable.
That's very much not readable.
Hmm.
Okay, we might have to parse this differently then.
What is wrong with this?
Or maybe it's an empty line.
So, we want to pectol opt this as well.
Maybe like that.
What the hell am I doing?
Uh we need one more brace there, right?
What's wrong here?
>> [sighs] >> Oh, wait. I put this in the wrong place.
So, you want to optional the sequence.
Right? All right, no. Wait.
We want to optional >> [sighs] >> the entire list tail.
This is so bad. Do Do not try this at home.
Okay, so we are now infiniting somewhere.
Which is not good.
Ah.
Okay, let's see if there's something else that we can use here.
And hopefully that will solve our problem.
Um Everything is really funny.
Okay, well, let's keep looking.
Why is there try catch? What are we doing?
Sounds like hopium.
Uh what does?
Everything, yeah. It's It is quite bad.
>> [laughter] >> It is It is going rough. It is going very rough.
Ah.
Oh, wait. We can just use pad.
Right?
Let's do Let's do pad around a list tail.
Right? Or can we just do list?
Yeah, we can do that. Let's Ah, let's just do a list.
Uh that's not what I wanted.
So, let's clear that up.
And then we want pectol pad.
And then we want more braces.
So, we have a list. And what does pad take again?
It takes an S.
So, this should be Oh, man.
Uh Wait.
Wait. Wait. Wait. Wait.
Hmm.
Hmm. Girl.
Let's just do it like this.
So, until either that or Pytol EOF. I hope this doesn't eat that up.
If it eats it up, that will cause big problems for us.
Um Yeah.
So, we can pad it with body not identifier.
And then list needs to take Oh, man.
So, we want R separated by S. So, we want body identifier separated by body not identifier.
Like that.
Jesus Christ.
This is terrible.
Hopefully, this still matches the whole line, though.
It is infiniting, which means it is in fact not matching the whole line.
Or it's matching too much of the line.
I think the end line is causing a problem here.
Let's do that.
Um Okay. And then we can pad with Ah, this this is so difficult.
I'm I'm going to L on this. I'm I'm tired of fighting with Pytol.
Let's Let's make a new chat.
This This library has officially broken me.
Read a line of C input and for define macro replacement.
Ah. Okay, this There's so much stuff here. No, no, no, no, no, no, no.
No, no, no. I'm I'm getting scared. I'm getting scared.
Okay, let's let's just worry about this next time. I think I have I've stared at this for too long. It has been like half an hour of me trying to figure this out.
Um so, yeah, we're >> [laughter] >> we're just going to save this for next time.
Um I don't think I need to commit anything here, though.
Yeah, let's not commit that. Let's just push what we have.
Um yeah.
So, anyways, um thank you all so much for showing up today.
Um if you haven't already, like the stream, sub to the channel.
Uh while you're down there, check out the description and join the Discord. Um also, my LinkedIn and GitHub are also down there. And my GitHub sponsors is also down there.
Um yeah, I'm going to >> [laughter] >> I'm going to like go crash out over whatever the hell I've just been working on. Um take care, y'all. Take it easy.
And I will see you all tomorrow, hopefully, in one piece.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
🚀 BCS613C Compiler Design | Module 1 to 5 Schema Evaluation 🔥 | VTU 6th Sem 💯 #VTU #bcs613c #exam
Pranavaa-y4y
104 views•2026-06-02











