/// <summary>
/// Parse an octal field
/// </summary>
private bool ParseOctal(TextParser input, FormatSpecifier spec)
{
// Skip any whitespace
input.MovePastWhitespace();
// Parse digits
int start = input.Position;
while (IsValidDigit(input.Peek(), 8))
{
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)
{
AddUnsigned(input.Extract(start, input.Position), spec.Modifier, 8);
}
return(true);
}
return(false);
}