Important: Your code for this part should go in buffer.py.
Your job in this part is to implement the current and pop_first methods of the Buffer class.
current should return the current token of the current line we’re on in the Buffer instance without removing it. If there are no more tokens in the current line, then current should move onto the next valid line, and return the first token of this line. If there are no more tokens left to return from the entire source (we’ve reached the end of all input lines), then current should return None (this logic is already provided for you in the except StopIteration block).
If we call current multiple times in a row, we should get the same result since calls to current won’t change what token we’re returning.
You may find self.index helpful while implementing these functions, but you are not required to reference it in your solution.
Hint: What instance attribute can we use to keep track of where we are in the current line?
Hint: If we’ve reached the end of the current line, then self.more_on_line() will return False. In that case, how do we “reset” our position to the beginning of the next line?
pop_first should return the current token of the Buffer instance, and move onto the next potential token (to be returned on the next call to pop_first). If there are no more tokens left to return from the entire source (we’ve reached the end of all input lines), then pop_first should return None.
Hint: Do we need to update anything to move onto the next potential token?