private Token ReadPunctuator(int firstChar)
{
// The most likely case is the the punctuator is a single character and is followed by a space.
var punctuator = PunctuatorToken.FromString(new string((char)firstChar, 1));
if (this.reader.Peek() == ' ')
return punctuator;
// Otherwise, read characters until we find a string that is not a punctuator.
var punctuatorText = new StringBuilder(4);
punctuatorText.Append((char)firstChar);
while (true)
{
int c = this.reader.Peek();
if (c == -1)
break;
// Try to parse the text as a punctuator.
punctuatorText.Append((char)c);
var longPunctuator = PunctuatorToken.FromString(punctuatorText.ToString());
if (longPunctuator == null)
break;
punctuator = longPunctuator;
// Advance the input stream.
ReadNextChar();
}
return punctuator;
}