{"record":{"id":"891e19149884ff5b","repo":"AvaloniaUI/Avalonia","slug":"expected-delimiter","errorCode":null,"errorMessage":"Expected '{delimiter}'.","messagePattern":"Expected '(.+?)'\\.","errorType":"validation","errorClass":"ExpressionParseException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Data/Core/Parsers/ArgumentListParser.cs","lineNumber":30,"sourceCode":"                var result = new List<string>();\n\n                r.Take();\n\n                while (!r.End)\n                {\n                    var argument = r.TakeWhile(c => c != delimiter && c != close && !char.IsWhiteSpace(c));\n                    if (argument.IsEmpty)\n                    {\n                        throw new ExpressionParseException(r.Position, \"Expected indexer argument.\");\n                    }\n\n                    result.Add(argument.ToString());\n\n                    r.SkipWhitespace();\n\n                    if (r.End)\n                    {\n                        throw new ExpressionParseException(r.Position, $\"Expected '{delimiter}'.\");\n                    }\n                    else if (r.TakeIf(close))\n                    {\n                        return result;\n                    }\n                    else\n                    {\n                        if (r.Take() != delimiter)\n                        {\n                            throw new ExpressionParseException(r.Position, $\"Expected '{delimiter}'.\");\n                        }\n\n                        r.SkipWhitespace();\n                    }\n                }\n\n                throw new ExpressionParseException(r.Position, $\"Expected '{close}'.\");\n            }","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Data/Core/Parsers/ArgumentListParser.cs#L12-L48","documentation":"ArgumentListParser.ParseArguments throws ExpressionParseException(\"Expected '{delimiter}'.\") at the line-30 branch when the reader reaches the end of input after consuming an argument but before finding the delimiter or the close bracket. The argument list is truncated mid-stream.","triggerScenarios":"An indexer argument list that is not terminated, e.g. `Items[0` (no closing bracket) — after reading `0`, End is true so neither delimiter nor close can be matched.","commonSituations":"Truncated binding path strings; string concatenation that drops the closing bracket; copy-paste errors in XAML path attributes.","solutions":["Terminate every indexer argument list with the close bracket (e.g. `Items[0]`).","Validate path strings end with `]` for indexers before use."],"exampleFix":"// before\n{Binding Items[0}\n// after\n{Binding Items[0]}","handlingStrategy":"try-catch","validationCode":"// Validate indexer paths are terminated with the close bracket.\nstatic bool IndexerIsTerminated(string path)\n{\n    int open = path.IndexOf('[');\n    if (open < 0) return true;\n    return path.IndexOf(']', open) >= 0;\n}\nif (!IndexerIsTerminated(path)) throw new ArgumentException(\"Unterminated indexer.\");","typeGuard":null,"tryCatchPattern":"try { var nodes = BindingExpressionGrammar.Parse(path); }\ncatch (ExpressionParseException ex) when (ex.Message.Contains(\"Expected\"))\n{ /* the path is malformed: check brackets/delimiters */ }","preventionTips":["Ensure every `[` has a matching `]`.","Validate generated path strings before use.","Review XAML after editing indexer expressions."],"tags":["data-binding","binding-path","parser","indexer"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}