{"record":{"id":"fdc77db77d40e720","repo":"tomnomnom/gron","slug":"unexpected-token-s","errorCode":null,"errorMessage":"unexpected token `%s`","messagePattern":"unexpected token `(.+?)`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ungron.go","lineNumber":438,"sourceCode":"\n\tcase t.typ == typNumericKey:\n\t\tkey, err := strconv.Atoi(t.text)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid integer key `%s`\", t.text)\n\t\t}\n\n\t\tval, err := ungronTokens(ts[1:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// There needs to be at least key + 1 space in the array\n\t\tout := make([]interface{}, key+1)\n\t\tout[key] = val\n\t\treturn out, nil\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unexpected token `%s`\", t.text)\n\t}\n}\n\n// recursiveMerge merges maps and slices, or returns b for scalars\nfunc recursiveMerge(a, b interface{}) (interface{}, error) {\n\tswitch a.(type) {\n\n\tcase map[string]interface{}:\n\t\tbMap, ok := b.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"cannot merge object with non-object\")\n\t\t}\n\t\treturn recursiveMapMerge(a.(map[string]interface{}), bMap)\n\n\tcase []interface{}:\n\t\tbSlice, ok := b.([]interface{})\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"cannot merge array with non-array\")","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/tomnomnom/gron/blob/88a6234ea2d0c487090988182ad9a7cdf6def924/ungron.go#L420-L456","documentation":"ungronTokens hit a token whose type matches none of its known cases (bare key, quoted key, numeric key, or value token), so the token stream is not a parseable assignment statement. The default branch is a generic guard against malformed or unexpected token streams.","triggerScenarios":"Thrown at ungron.go:438 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the input grammar so the token stream only contains valid assignment tokens","Check whether the token came from truncated input such as a statement missing the '=' and value part"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88a6234ea2d0c487090988182ad9a7cdf6def924","analyzedAt":"2026-09-06T11:35:31.658Z","contentChangedAt":"2026-09-06T11:35:31.658Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}