Adds closure rules for BEGINS-ON and ENDS-ON