{"record":{"id":"6c4e509f64ac4657","repo":"AvaloniaUI/Avalonia","slug":"unexpected-data","errorCode":null,"errorMessage":"Unexpected data ","messagePattern":"Unexpected data ","errorType":"exception","errorClass":"ExpressionParseException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs","lineNumber":18,"sourceCode":"using System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\n\n// ReSharper disable StringLiteralTypo\n\nnamespace Avalonia.Rendering.Composition.Expressions\n{\n    internal class ExpressionParser\n    {\n        public static Expression Parse(ReadOnlySpan<char> s)\n        {\n            var p = new TokenParser(s);\n            var parsed = ParseTillTerminator(ref p, \"\", false, false, out _);\n            p.SkipWhitespace();\n            if (p.Length != 0)\n                throw new ExpressionParseException(\"Unexpected data \", p.Position);\n            return parsed;\n        }\n\n        private static ReadOnlySpan<char> Dot => \".\".AsSpan();\n        static bool TryParseAtomic(ref TokenParser parser, \n            [MaybeNullWhen(returnValue: false)] out Expression expr)\n        {\n            // We can parse keywords, parameter names and constants\n            expr = null;\n            if (parser.TryParseKeywordLowerCase(ExpressionKeywords.StartingValue))\n                expr = new KeywordExpression(ExpressionKeyword.StartingValue);\n            else if(parser.TryParseKeywordLowerCase(ExpressionKeywords.CurrentValue))\n                expr = new KeywordExpression(ExpressionKeyword.CurrentValue);\n            else if(parser.TryParseKeywordLowerCase(ExpressionKeywords.FinalValue))\n                expr = new KeywordExpression(ExpressionKeyword.FinalValue);\n            else if(parser.TryParseKeywordLowerCase(ExpressionKeywords.Pi))\n                expr = new KeywordExpression(ExpressionKeyword.Pi);\n            else if(parser.TryParseKeywordLowerCase(ExpressionKeywords.True))","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs#L1-L36","documentation":"Error \"Unexpected data \" thrown in AvaloniaUI/Avalonia.","triggerScenarios":"Raised by the composition expression parser when extra tokens remain after a complete expression was parsed. Defend by validating expression strings before assigning them to composition animations and by rejecting trailing characters after the top-level expression.","commonSituations":"See trigger scenarios.","solutions":["Fix the composition expression syntax: remove the trailing or unexpected extra tokens (e.g. an unmatched operator or closing parenthesis) from the expression string.","Validate the expression with a known-good sample from the Avalonia composition animation docs before using it in StartAnimation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}