private Token GetCurrentToken() { if (currentToken == null) { while (scanner.MoveNextWithoutConsuming()) { currentToken = scanner.Current; var commentToken = currentToken as Comment; if (commentToken != null) { pendingEvents.Enqueue(new Events.Comment(commentToken.Value, commentToken.IsInline, commentToken.Start, commentToken.End)); } else { break; } } } return currentToken; }
private void Skip() { if (currentToken != null) { currentToken = null; scanner.ConsumeCurrent(); } }
/// <summary> /// Consumes the current token and increments the parsed token count /// </summary> public void ConsumeCurrent() { ++tokensParsed; tokenAvailable = false; previous = Current; Current = null; }