{"record":{"id":"16a8765645922dbb","repo":"stride3d/stride","slug":"while-parsing-a-block-collection-did-not-find-expected","errorCode":null,"errorMessage":"While parsing a block collection, did not find expected '-' indicator.","messagePattern":"While parsing a block collection, did not find expected '-' indicator\\.","errorType":"exception","errorClass":"SemanticErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Parser.cs","lineNumber":632,"sourceCode":"                else\n                {\n                    state = ParserState.YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE;\n                    return ProcessEmptyScalar(mark);\n                }\n            }\n\n            else if (GetCurrentToken() is BlockEnd)\n            {\n                state = states.Pop();\n                Event evt = new Events.SequenceEnd(GetCurrentToken().Start, GetCurrentToken().End);\n                Skip();\n                return evt;\n            }\n\n            else\n            {\n                var current = GetCurrentToken();\n                throw new SemanticErrorException(current.Start, current.End, \"While parsing a block collection, did not find expected '-' indicator.\");\n            }\n        }\n\n        /// <summary>\n        /// Parse the productions:\n        /// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+\n        ///                           *********** *\n        /// </summary>\n        private Event ParseIndentlessSequenceEntry()\n        {\n            if (GetCurrentToken() is BlockEntry)\n            {\n                Mark mark = GetCurrentToken().End;\n                Skip();\n\n                if (!(GetCurrentToken() is BlockEntry || GetCurrentToken() is Key || GetCurrentToken() is Value || GetCurrentToken() is BlockEnd))\n                {\n                    states.Push(ParserState.YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE);","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Parser.cs#L614-L650","documentation":"In the block-sequence state, the parser expects each entry to begin with a BLOCK-ENTRY token ('-'). When it encounters any other token, ParseBlockSequenceEntry throws SemanticErrorException at that token's span, indicating the sequence is malformed at that point.","triggerScenarios":"Mixing indentation and '-' incorrectly, e.g. a non-'-' token at the sequence's indentation level: \"list:\\n- a\\nb: c\" where 'b: c' appears at sequence-entry column; or inconsistent indentation of '-' items.","commonSituations":"Hand-edited lists where an item lost its leading '- ', tab/space indentation mismatches, converting between flow and block styles partially.","solutions":["Ensure every item at the sequence indentation level starts with '-'","Fix inconsistent indentation so sequence items align and are more indented than the parent key","Replace tabs with spaces — YAML forbids tabs for indentation"],"exampleFix":"// before\nlist:\n- a\nb: c\n// after\nlist:\n- a\nother: c","handlingStrategy":"try-catch","validationCode":"// reject tabs and flag items at sequence level lacking '-'\nif (text.Contains('\\t')) throw new InvalidDataException(\"Tabs are not allowed in YAML indentation\");","typeGuard":null,"tryCatchPattern":"try { stream.Load(reader); } catch (SemanticErrorException ex) when (ex.Message.Contains(\"'-' indicator\")) { throw new YamlConfigException($\"Malformed block sequence near {ex.Start}\", ex); }","preventionTips":["Use spaces, never tabs, for YAML indentation","Keep '-' items aligned at the same column","Lint YAML before loading user-edited files"],"tags":["yaml","parser","syntax-error","block-sequence"],"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"}