klyn.code.go.GoTokenizer.classifyIdentifier
method
public override classifyIdentifier(
token as String,
line as String,
endIndex as Long,
previousWord as String,
inQueryBlock as Boolean
) as TokenKind
Description

Classifies Go identifiers, recognizing type <Name> declarations, receiver method names, package-qualified types (context.Context, *http.Request), and built-in calls.

Parameters
ParameterDescription
tokenIdentifier text.
lineFull source line.
endIndexExclusive end index of token in line.
previousWordImmediately preceding word on the line.
inQueryBlockUnused in Go (false).
Returns

Resolved TokenKind.

Example
import klyn.code
import klyn.code.go

t = GoTokenizer()
assert t.classifyIdentifier("Server", "type Server struct {", 11, "type", false) == TokenKind.DECLARATION_NAME