correctly identifying left-recursive nodes