Example #1
0
		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;
		}
Example #2
0
		private void Skip()
		{
			if (currentToken != null)
			{
				currentToken = null;
				scanner.ConsumeCurrent();
			}
		}
Example #3
0
		/// <summary>
		/// Consumes the current token and increments the parsed token count
		/// </summary>
		public void ConsumeCurrent()
		{
			++tokensParsed;
			tokenAvailable = false;
			previous = Current;
			Current = null;
		}