public override classifyIdentifier( token as String, line as String, endIndex as Long, previousWord as String, inQueryBlock as Boolean ) as TokenKind
Classifies Go identifiers, recognizing type <Name> declarations, receiver method names, package-qualified types (context.Context, *http.Request), and built-in calls.
| Parameter | Description |
|---|---|
token | Identifier text. |
line | Full source line. |
endIndex | Exclusive end index of token in line. |
previousWord | Immediately preceding word on the line. |
inQueryBlock | Unused in Go (false). |
Resolved TokenKind.
import klyn.code
import klyn.code.go
t = GoTokenizer()
assert t.classifyIdentifier("Server", "type Server struct {", 11, "type", false) == TokenKind.DECLARATION_NAME