MCPcopy Create free account
hub / github.com/cogentcore/core / Equal

Method Equal

parse/token/token.go:192–197  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
192func (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:

Callers 15

TestFrustumSetFunction · 0.80
TestFrustumSetFromMatrixFunction · 0.80
TestVector3iFunction · 0.80
TestBox3MulMatrix4Function · 0.80
TestBox3MulQuatFunction · 0.80
TestBox3MVProjToNDCFunction · 0.80
TestVector2Function · 0.80
TestMatrix2Function · 0.80
TestMatrix2SetStringFunction · 0.80
TestMatrix2StringFunction · 0.80
TestBarycoordFromPointFunction · 0.80
TestArrayF32GetMatrix4Function · 0.80

Calls 1

IsKeywordMethod · 0.80

Tested by 15

TestFrustumSetFunction · 0.64
TestFrustumSetFromMatrixFunction · 0.64
TestVector3iFunction · 0.64
TestBox3MulMatrix4Function · 0.64
TestBox3MulQuatFunction · 0.64
TestBox3MVProjToNDCFunction · 0.64
TestVector2Function · 0.64
TestMatrix2Function · 0.64
TestMatrix2SetStringFunction · 0.64
TestMatrix2StringFunction · 0.64
TestBarycoordFromPointFunction · 0.64
TestArrayF32GetMatrix4Function · 0.64