/// <summary>
/// Parse a string field
/// </summary>
private bool ParseString(TextParser input, FormatSpecifier spec)
{
// Skip any whitespace
input.MovePastWhitespace();
// Parse string characters
int start = input.Position;
while (!input.EndOfText && !Char.IsWhiteSpace(input.Peek()))
{
input.MoveAhead();
}
// Don't exceed field width
if (spec.Width > 0)
{
int count = input.Position - start;
if (spec.Width < count)
{
input.MoveAhead(spec.Width - count);
}
}
// Extract token
if (input.Position > start)
{
if (!spec.NoResult)
{
Results.Add(input.Extract(start, input.Position));
}
return(true);
}
return(false);
}