Archived
1

Cleaned Imports

This commit is contained in:
Kim Wittenburg
2014-11-08 01:05:08 +01:00
parent 139a75f816
commit f4f924bd71
80 changed files with 237 additions and 164 deletions

View File

@@ -8,6 +8,8 @@
#import "MPTokenStream.h"
#import "MPToken.h"
@implementation MPTokenStream {
NSUInteger _currentTokenIndex;
NSUInteger eofLocation;
@@ -86,7 +88,7 @@
return _currentTokenIndex < self.tokens.count;
}
- (MPToken *)currentToken
- (id<MPToken>)currentToken
{
[self skipWhitespaces];
if (_currentTokenIndex >= _tokens.count) {
@@ -95,11 +97,11 @@
return _tokens[_currentTokenIndex];
}
- (MPToken *)peekNextToken
- (id<MPToken>)peekNextToken
{
NSUInteger currentTokenIndex = _currentTokenIndex;
[self currentTokenConsumed]; // Pretend the current token has been consumed
MPToken *token = [self currentToken];
id<MPToken> token = [self currentToken];
_currentTokenIndex = currentTokenIndex; // Undo the lookahead
return token;
}