{"record":{"id":"aea230b320d6417b","repo":"stride3d/stride","slug":"block-sequence-entries-are-not-allowed-in-this-context","errorCode":null,"errorMessage":"Block sequence entries are not allowed in this context.","messagePattern":"Block sequence entries are not allowed in this context\\.","errorType":"exception","errorClass":"SyntaxErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Scanner.cs","lineNumber":942,"sourceCode":"            // Create the FLOW-ENTRY token and append it to the queue.\n\n            tokens.Enqueue(new FlowEntry(start, mark));\n        }\n\n        /// <summary>\n        /// Produce the BLOCK-ENTRY token.\n        /// </summary>\n        private void FetchBlockEntry()\n        {\n            // Check if the scanner is in the block context.\n\n            if (flowLevel == 0)\n            {\n                // Check if we are allowed to start a new entry.\n\n                if (!simpleKeyAllowed)\n                {\n                    throw new SyntaxErrorException(mark, mark, \"Block sequence entries are not allowed in this context.\");\n                }\n\n                // Add the BLOCK-SEQUENCE-START token if needed.\n                RollIndent(mark.Column, -1, true, mark);\n            }\n            else\n            {\n                // It is an error for the '-' indicator to occur in the flow context,\n                // but we let the Parser detect and report about it because the Parser\n                // is able to point to the context.\n            }\n\n            // Reset any potential simple keys on the current flow level.\n\n            RemoveSimpleKey();\n\n            // Simple keys are allowed after '-'.\n","sourceCodeStart":924,"sourceCodeEnd":960,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Scanner.cs#L924-L960","documentation":"A '-' block sequence entry indicator was found where a new sequence entry is not permitted. In block context, a '-' entry can only start where a new node may begin; here simpleKeyAllowed is false (e.g. '-' appears after another scalar on the same line).","triggerScenarios":"Writing '- item' on the same line as a previous scalar (e.g. 'key: value - next'), or a '-' appearing after a key without a value separator in a position the scanner disallows.","commonSituations":"Collapsing list items onto one line in a config file, or converting block style to inline style incorrectly (a '-' inside a flow sequence is invalid).","solutions":["Put each '- item' on its own line at consistent indentation","Remove the '-' if the sequence was meant to be inline (use [a, b] flow style instead)","Ensure the '-' follows a line break or a key ending with ':'"],"exampleFix":"// before\nkey: value - next\n// after\nkey:\n  - value\n  - next","handlingStrategy":"validation","validationCode":"// Block sequence entries must start at line beginning after indentation\nvar lines = yamlText.Split('\\n'); foreach (var l in lines) { var idx = l.IndexOf(\" - \"); if (idx > 0 && l.Substring(0, idx).Trim().Length > 0 && !l.Substring(0, idx).TrimEnd().EndsWith(\":\")) throw new FormatException(\"Inline '-' after scalar: \" + l); }","typeGuard":null,"tryCatchPattern":"catch (SyntaxErrorException ex) { throw new ConfigFormatException($\"'-' not allowed near {ex.Start.Line}:{ex.Start.Column}\"); }","preventionTips":["Put each '- item' on its own line","Use flow style [a, b] for inline lists instead of '-'","Keep indentation consistent for sequence entries"],"tags":["yaml","scanner","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-16T04:17:20.429Z"}