This line of code is making my brain hurt a little bit, even with the comment

it's sad, because if it was `depth += !!open - !!close` it would make so much more sense, the -= of negation is tricky to follow :)