parser: Count occurrences of newlines