If the inheritance syntax is used the line number isn't incremented.
Meaning, if rune == '\n' here, then p.line needs to be incremented:
I'd add that before the successful return at the end of the function, so that if an error is reported it points at the correct line:
if inherited {
p.line++
}
return key, cutset, inherited, nil
}