{"record":{"id":"9c31bfbc63127dc9","repo":"ssssssss-team/spider-flow","slug":"expected-but-got-token-text-9c31bf","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":177,"sourceCode":"\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\n\t}\r\n\r\n\tprivate static Expression parseAccessOrCall (TokenStream stream,TokenType tokenType) {\r\n\t\t//Span identifier = stream.expect(TokenType.Identifier);\r","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/ssssssss-team/spider-flow/blob/c799cca99c7d064673dc79e6ef06a08bbc0e292d/spider-flow-core/src/main/java/org/spiderflow/core/expression/parsing/Parser.java#L159-L195","documentation":"Parser syntax error raised in parseMapLiteral: after a key:value pair, if the next token is not '}' the parser expects a comma (or the closing curly); stream.expect failed on some other token. The input at fault is a malformed map literal such as {a: 1 b: 2} (missing comma between pairs) or an unterminated {a: 1. Reached via parseAccessOrCallOrLiteral whenever an expression begins with '{'.","triggerScenarios":"Thrown at spider-flow-core/src/main/java/org/spiderflow/core/expression/parsing/Parser.java:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Separate map entries with commas: {a: 1, b: 2}.","Add the closing '}' so the map literal is terminated.","Count braces in the expression — an unclosed '{' earlier in the expression can push parsing into this branch.","Test the expression in the expression editor to pinpoint the failing token."],"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"}