Hello and welcome, everybody.
And in this lecture we're going to implement, continue and Break, which are to be used in wild loops
and for loops.
So let's start with continue in our paths dot c file.
We're going to create a new function called Void Paths Continue and that will take a history as well
goes.
So we're just going to say expect keyword, continue, expect awesome semicolon, nice and simple.
And now we're going to say make continue node, which we haven't created yet.
So let's head over to Node C and we're going to create that.
So just copy and paste, make expression, note, get rid of all the arguments and we're going to say
make continue note.
And essentially all it's going to do is set the type to no type statement continue
while we're here.
We're also going to make one for break.
So just to make break note.
And change that to statement break.
I just copy and paste the prototypes, paste it above, make special note in the compiler file so it's
accessible.
And there we go.
Now we have those prototypes set back deposited.
See, we can see that that now works correctly.
So we're going to do the same for break void pause break struct history.
History.
Expect keyword break.
Expect some semicolon, make or break node.
Now we need to actually call these functions.
So we're going to search for parse keyword.
Click on that function.
And just by here we're going to say if SW equal token SW foul.
Then pause, break and then make that an elseif.
And then we're going to say elseif s equal.
Token s file.
Continue.
Pause continue and we need to pass these histories in their perfect.
So we can see pause, break and pause continue.
In my example are a greater line number than past keyword, which means they won't be able to be resolved.
So what I'm going to do and a copy and paste both of these, I'm going to press back.
And I'm just going to paste them above pause keyword just so it can resolve them down here.
So now we're going to try a make clean and to make.
See that can pass.
Fine.
Let's go to test at sea and we're going to do well, one and we're going to say break.
We're just going to see if that works.
So we're going to say dot main, everything compiled.
Fine.
We're going to do continue.
And we're going to try that.
And we can see everything works perfect.
Well done on implementing break and continue.