{"record":{"id":"aa2c7262011c2fc3","repo":"ssssssss-team/spider-flow","slug":"expected-but-got-token-text","errorCode":null,"errorMessage":"Expected ':', but got '<token text>'","messagePattern":"Expected ':', but got '<token text>'","errorType":"panic","errorClass":"ExpressionError","httpStatus":null,"severity":"error","filePath":"spider-flow-core/src/main/java/org/spiderflow/core/expression/parsing/Parser.java","lineNumber":173,"sourceCode":"\t\t} else {\r\n\t\t\tExpressionError.error(\"Expected a variable, field, map, array, function or method call, or literal.\", stream);\r\n\t\t\treturn null; // not reached\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static Expression parseMapLiteral (TokenStream stream) {\r\n\t\tSpan openCurly = stream.expect(TokenType.LeftCurly).getSpan();\r\n\r\n\t\tList<Token> keys = new ArrayList<>();\r\n\t\tList<Expression> values = new ArrayList<>();\r\n\t\twhile (stream.hasMore() && !stream.match(\"}\", false)) {\r\n\t\t\tif(stream.match(TokenType.StringLiteral, false)){\r\n\t\t\t\tkeys.add(stream.expect(TokenType.StringLiteral));\r\n\t\t\t}else{\r\n\t\t\t\tkeys.add(stream.expect(TokenType.Identifier));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tstream.expect(\":\");\r\n\t\t\tvalues.add(parseExpression(stream));\r\n\t\t\tif (!stream.match(\"}\", false)) stream.expect(TokenType.Comma);\r\n\t\t}\r\n\t\tSpan closeCurly = stream.expect(\"}\").getSpan();\r\n\t\treturn new MapLiteral(new Span(openCurly, closeCurly), keys, values);\r\n\t}\r\n\r\n\tprivate static Expression parseListLiteral (TokenStream stream) {\r\n\t\tSpan openBracket = stream.expect(TokenType.LeftBracket).getSpan();\r\n\r\n\t\tList<Expression> values = new ArrayList<>();\r\n\t\twhile (stream.hasMore() && !stream.match(TokenType.RightBracket, false)) {\r\n\t\t\tvalues.add(parseExpression(stream));\r\n\t\t\tif (!stream.match(TokenType.RightBracket, false)) stream.expect(TokenType.Comma);\r\n\t\t}\r\n\r\n\t\tSpan closeBracket = stream.expect(TokenType.RightBracket).getSpan();\r\n\t\treturn new ListLiteral(new Span(openBracket, closeBracket), values);\r","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/ssssssss-team/spider-flow/blob/c799cca99c7d064673dc79e6ef06a08bbc0e292d/spider-flow-core/src/main/java/org/spiderflow/core/expression/parsing/Parser.java#L155-L191","documentation":"Parser syntax error raised in parseMapLiteral: after parsing a key expression in a {key: value} map literal, stream.expect(':') failed because the next token is not a colon. The input at fault is the map-literal source text — e.g. {a b} or {a = 1} — missing the required ':' between key and value. Since parseMapLiteral is reached from parseAccessOrCallOrLiteral, any expression starting with '{' takes this path.","triggerScenarios":"Thrown at spider-flow-core/src/main/java/org/spiderflow/core/expression/parsing/Parser.java:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the missing ':' between each key and value in the map literal, e.g. {'name': 'x'}.","Check the expression for a stray comma or omitted value that shifted token alignment.","Validate the whole expression in an editor/test panel before saving the flow."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c799cca99c7d064673dc79e6ef06a08bbc0e292d","analyzedAt":"2026-09-08T13:47:08.225Z","contentChangedAt":"2026-09-08T13:47:08.225Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}