{"record":{"id":"90d53d08c6ea9852","repo":"stride3d/stride","slug":"while-parsing-a-flow-sequence-did-not-find-expected-or","errorCode":null,"errorMessage":"While parsing a flow sequence, did not find expected ',' or ']'.","messagePattern":"While parsing a flow sequence, did not find expected ',' or '\\]'\\.","errorType":"exception","errorClass":"SemanticErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Parser.cs","lineNumber":786,"sourceCode":"            if (isFirst)\n            {\n                GetCurrentToken();\n                Skip();\n            }\n\n            Event evt;\n            if (!(GetCurrentToken() is FlowSequenceEnd))\n            {\n                if (!isFirst)\n                {\n                    if (GetCurrentToken() is FlowEntry)\n                    {\n                        Skip();\n                    }\n                    else\n                    {\n                        var current = GetCurrentToken();\n                        throw new SemanticErrorException(current.Start, current.End, \"While parsing a flow sequence, did not find expected ',' or ']'.\");\n                    }\n                }\n\n                if (GetCurrentToken() is Key)\n                {\n                    state = ParserState.YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE;\n                    evt = new Events.MappingStart(null, null, true, DataStyle.Compact);\n                    Skip();\n                    return evt;\n                }\n                else if (!(GetCurrentToken() is FlowSequenceEnd))\n                {\n                    states.Push(ParserState.YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE);\n                    return ParseNode(false, false);\n                }\n            }\n\n            state = states.Pop();","sourceCodeStart":768,"sourceCodeEnd":804,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Parser.cs#L768-L804","documentation":"In a flow-style sequence ([a, b, c]), the parser found a token after an entry that is neither a comma separator nor the closing bracket. Flow sequences require entries separated by ',' and terminated by ']'.","triggerScenarios":"A flow sequence like [a b] (missing comma) or [a, b (unclosed bracket), or an invalid token such as a stray '}' or ':' inside [ ... ].","commonSituations":"Writing inline arrays in config files (e.g. ports: [80 443]) and forgetting a comma, or truncating the file so the ']' is lost.","solutions":["Check the reported location and insert the missing ',' between flow-sequence entries","Add the missing ']' to close the flow sequence","Ensure no stray characters (e.g. '}' or ']' from another nesting level) appear inside the sequence","Run a YAML linter on the document"],"exampleFix":"// before\nports: [80 443\n// after\nports: [80, 443]","handlingStrategy":"validation","validationCode":"// Balance-check brackets before loading\nint depth=0; foreach (var c in yamlText) { if (c=='['||c=='{') depth++; if (c==']'||c=='}') depth--; if (depth<0) throw new FormatException(\"Unbalanced brackets\"); }","typeGuard":null,"tryCatchPattern":"try { yaml.Load(reader); } catch (YamlException ex) { throw new ConfigFormatException($\"Flow sequence error at {ex.Start.Line}:{ex.Start.Column}\"); }","preventionTips":["Prefer block-style sequences over inline [ ] style in config files","Check comma placement whenever editing inline arrays","Use an editor with YAML syntax highlighting and bracket matching"],"tags":["yaml","parser","flow-style","syntax"],"backgroundTag":"yaml-parse-error","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}