handle cases where we have a node with width 0 when reporting grammar errors

Behavior before the change, was an assert as length < 0.