public class GoTokenizer extends CodeTokenizer
Specialized CodeTokenizer for Go source files (.go).
Supports Go raw backtick string literals ( ... ) where backslashes are not escape sequences, imaginary numeric suffixes (42i, 3.14i), //go: compiler directives, type Name struct/interface declarations, and receiver method declarations (func (s *Server) Handle(...)).
import klyn.code
import klyn.code.go
tokenizer = GoTokenizer()
res = tokenizer.tokenizeLine("func (s *Server) Start(ctx context.Context) error {")
assert res.spans[0].kind == TokenKind.KEYWORD| Modifier and Type | Member | Description |
|---|---|---|
| public | GoTokenizer | Constructs a GoTokenizer configured with GoLanguage.profile(). |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | classifyIdentifier | Classifies Go identifiers, recognizing type <Name> declarations, receiver method names, package-qualified types (context.Context, *http.Request), and built-in calls. |