private int Indents(int spaces, int line)
{
spacesPerGroup = spacesPerGroup == 0 ? spaces : spacesPerGroup;
if(spacesPerGroup != 0)
{
if (spaces % spacesPerGroup != 0)
throw new InconsistentWhitespaceException(string.Format(
"Expected {0} spaces per indent, but got {1} on line {2}, which is not divisible by {0}",
spacesPerGroup, spaces, line));
return spaces / spacesPerGroup;
}
return 0;
}