{"record":{"id":"6195dabee5f2f82e","repo":"antonmedv/fx","slug":"unknown-token-type-v","errorCode":null,"errorMessage":"Unknown token type: %v","messagePattern":"Unknown token type: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/shlex/shlex.go","lineNumber":162,"sourceCode":"func NewLexer(r io.Reader) *Lexer {\n\treturn (*Lexer)(NewTokenizer(r))\n}\n\n// Next returns the next word, or an error. If there are no more words,\n// the error will be io.EOF.\nfunc (l *Lexer) Next() (string, error) {\n\tfor {\n\t\ttoken, err := (*Tokenizer)(l).Next()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tswitch token.tokenType {\n\t\tcase WordToken:\n\t\t\treturn token.value, nil\n\t\tcase CommentToken:\n\t\t\t// skip comments\n\t\tdefault:\n\t\t\treturn \"\", fmt.Errorf(\"Unknown token type: %v\", token.tokenType)\n\t\t}\n\t}\n}\n\n// Tokenizer turns an input stream into a sequence of typed tokens\ntype Tokenizer struct {\n\tinput      bufio.Reader\n\tclassifier tokenClassifier\n}\n\n// NewTokenizer creates a new tokenizer from an input stream.\nfunc NewTokenizer(r io.Reader) *Tokenizer {\n\tinput := bufio.NewReader(r)\n\tclassifier := newDefaultClassifier()\n\treturn &Tokenizer{\n\t\tinput:      *input,\n\t\tclassifier: classifier}\n}","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/antonmedv/fx/blob/4f31cd3a0c5d66f1b4290a2719bab14a5cee8ebe/internal/shlex/shlex.go#L144-L180","documentation":"Catch-all in Lexer.Next for a token type that is neither Word nor Comment. Under normal operation the tokenizer only emits word, comment, and EOF states, so this fires only on an internal inconsistency or an unhandled token type from a modified/extended tokenizer — effectively an unreachable-by-design guard.","triggerScenarios":"Thrown at internal/shlex/shlex.go:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the token stream for non-word tokens the lexer does not handle","Update the switch to handle the reported token type","Report as a bug if triggered by ordinary shell-like input"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4f31cd3a0c5d66f1b4290a2719bab14a5cee8ebe","analyzedAt":"2026-09-02T02:17:47.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}