{"record":{"id":"aa767f41c22256a8","repo":"unoplatform/uno","slug":"invalid-identifier-character-current","errorCode":null,"errorMessage":"Invalid identifier character {Current}","messagePattern":"Invalid identifier character (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs","lineNumber":231,"sourceCode":"\n\t\t\t\t\tpath = new XBindIndexerAccess() { Path = path, Index = _xBind.Substring(currentPosition, _position - currentPosition) };\n\t\t\t\t\t_position++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn path;\n\t\t}\n\n\t\tprivate XBindIdentifier ParseXBindIdentifier()\n\t\t{\n\t\t\tvar identifierStart = _position;\n\t\t\tif (!TryEatValidIdentifier())\n\t\t\t{\n\t\t\t\tthrow new Exception($\"Invalid identifier character {Current}\");\n\t\t\t}\n\n\t\t\tif (Current == ':' && LookAhead == ':')\n\t\t\t{\n\t\t\t\t_position += 2;\n\n\t\t\t\tif (!TryEatValidIdentifier())\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception($\"Invalid identifier character {Current}\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new XBindIdentifier() { IdentifierText = _xBind.Substring(identifierStart, _position - identifierStart) };\n\t\t}\n\n\t\tprivate bool TryEatValidIdentifier()\n\t\t{\n\t\t\tvar foundValid = false;","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs#L213-L249","documentation":"Thrown by ParseXBindIdentifier when the very first character of an expected identifier is not a valid identifier character (letter, digit, or underscore). The parser calls TryEatValidIdentifier, which returns false if no letter/digit/underscore was consumed at all.","triggerScenarios":"An x:Bind path contains a character that starts an identifier but is invalid — e.g. a symbol like '+', '-', '@', or a parenthesis/dot in a position where the parser expects an identifier name.","commonSituations":"Expression-style x:Bind that the parser does not support (e.g. arithmetic operators); a malformed path after a '.' or at the start of the binding; stray markup characters copied into the binding string.","solutions":["Inspect the x:Bind path at the reported position and replace the invalid character with a valid identifier.","If you intended an operator or expression, rewrite the binding using a function or a property that returns the computed value.","Remove any stray non-identifier characters from the path."],"exampleFix":"<!-- before -->\n<Text Text=\"{x:Bind @Name}\" />\n<!-- after -->\n<Text Text=\"{x:Bind Name}\" />","handlingStrategy":"validation","validationCode":"// Validate x:Bind path identifiers start with a letter, digit, or underscore:\n// Linting check: identifier boundaries in x:Bind should not start with symbols like @, +, -, etc.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid arithmetic operators and unsupported symbols in x:Bind paths.","If you need computation, expose a property on the ViewModel.","Review x:Bind expressions for stray characters after copy-paste."],"tags":["xbind","xaml","parser","source-generator","identifier"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}