apply optimization also to the first token of the rule