Fixed infinite loop in yacc

Test Plan:
<see below>