Equal compares equality of two tokens including keywords if token is in Keyword category. See also Match for version that uses category / subcategory matching
(okt KeyToken)
| 190 | // Equal compares equality of two tokens including keywords if token is in Keyword category. |
| 191 | // See also Match for version that uses category / subcategory matching |
| 192 | func (kt KeyToken) Equal(okt KeyToken) bool { |
| 193 | if kt.Token.IsKeyword() && kt.Key != "" { |
| 194 | return kt.Token == okt.Token && kt.Key == okt.Key |
| 195 | } |
| 196 | return kt.Token == okt.Token |
| 197 | } |
| 198 | |
| 199 | // Match compares equality of two tokens including keywords if token is in Keyword category. |
| 200 | // returns true if the two tokens match, in a category / subcategory sensitive manner: |