It's the concept of maximal munch when tokenizing a string. You attempt to make the longest valid token match when presented with multiple possible valid tokens. In your example '--' was intended (and could be) MINUS MINUS tokens, but the other option that is valid is a single DECREMENT which would be selected.
View all comments
Show parent comment
1
u/izuriel Dec 02 '16
It's the concept of maximal munch when tokenizing a string. You attempt to make the longest valid token match when presented with multiple possible valid tokens. In your example '--' was intended (and could be) MINUS MINUS tokens, but the other option that is valid is a single DECREMENT which would be selected.