W102 Literal that an earlier literal shadowsΒΆ

A literal stands in a choice after a literal that it starts with. The earlier one matches wherever the later one would, and a choice takes the first alternative that matches, so the later one is never taken.

start: NUMBER op=("<" | "<=") NUMBER
NUMBER: [0-9]+
grammar.fpeg:1:25: warning[W102]: "<=" never matches here, since "<" before it matches first

Put the longer literal first.

start: NUMBER op=("<=" | "<") NUMBER
NUMBER: [0-9]+

In a grammar with %word, a literal of a rule that ends in a word character does not match in front of another word character. So "in" | "inner" works there as it stands and is not reported. Inside a terminal no such boundary holds, and the same choice is reported.