static bool ParseWhitespace(string input, ref int pos)
{
int end = pos;
while (end < input.Length && char.IsWhiteSpace(input[end]))
end++;
var found = pos != end;
pos = end;
return found;
}
static bool ParseLimitedWhitespace(string input, ref int pos, int maxNewlinesToConsume)