{"record":{"id":"4063972d2a8ada36","repo":"babalae/better-genshin-impact","slug":"keys-value","errorCode":null,"errorMessage":"无法解析音符 {keys} 的时值：{value}","messagePattern":"无法解析音符 (.+?) 的时值：(.+?)","errorType":"exception","errorClass":"FormatException","httpStatus":null,"severity":"warning","filePath":"BetterGenshinImpact/GameTask/Music/Service/MusicScoreParser.cs","lineNumber":329,"sourceCode":"            {\n                throw new FormatException($\"音符 {keys} 的时值缺少右方括号\");\n            }\n\n            var value = sheet[(index + 1)..bracketEnd];\n            index = bracketEnd + 1;\n            if (value is \"^\" or \"&\")\n            {\n                tokens.Add(new YuanQinToken(keys, 0, value));\n                continue;\n            }\n\n            var separator = value.IndexOf('-');\n            var denominatorText = separator >= 0 ? value[..separator] : value;\n            var special = separator >= 0 ? value[(separator + 1)..] : \"none\";\n            if (!double.TryParse(denominatorText, NumberStyles.Float, CultureInfo.InvariantCulture,\n                    out var denominator))\n            {\n                throw new FormatException($\"无法解析音符 {keys} 的时值：{value}\");\n            }\n\n            tokens.Add(new YuanQinToken(keys, denominator, special));\n        }\n\n        return tokens;\n    }\n\n    private static List<YuanQinToken> ParseYuanQinTokens(JArray notes)\n    {\n        var tokens = new List<YuanQinToken>(notes.Count);\n        foreach (var item in notes)\n        {\n            if (item is not JObject note)\n            {\n                throw new FormatException(\"yuanqin 音符数组中包含非对象元素\");\n            }\n","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/Music/Service/MusicScoreParser.cs#L311-L347","documentation":"Thrown by MusicScoreParser.ParseYuanQinTokens(string) when the content inside the duration brackets [...] cannot be parsed as a number. The value before an optional '-' separator is parsed with double.TryParse using invariant culture; if it fails, the entire bracket value is reported as unparseable.","triggerScenarios":"A yuanqin sheet where the duration bracket contains non-numeric text before the separator. Valid values are like '1', '2', '1-#', '8-*'. Invalid: 'x', 'abc', or any non-numeric leading segment.","commonSituations":"Manual score authoring with a typo in the duration value; an unsupported special character placed before the '-' separator; a score format from an incompatible tool.","solutions":["Inspect the duration bracket content reported in the error message and ensure the part before any '-' is a valid number.","Review yuanqin syntax: duration is a number, optionally followed by '-' and a special modifier (e.g. '#', '*', '$', 'none').","Fix the score file to use valid numeric durations."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate duration values are numeric\nforeach (Match m in Regex.Matches(sheet, @\"\\[([^\\]]+)\\]\"))\n{\n    var val = m.Groups[1].Value.Split('-')[0];\n    if (!double.TryParse(val, CultureInfo.InvariantCulture, out _))\n        logger.LogError(\"无法解析时值：{Value}\", m.Groups[1].Value);\n}","typeGuard":null,"tryCatchPattern":"var score = await parser.ParseAsync(path, rootFolder, ct);\nif (!string.IsNullOrEmpty(score.Error)) { logger.LogWarning(score.Error); }","preventionTips":["Ensure duration brackets contain valid numeric values before any '-' separator.","Follow yuanqin syntax: [number] or [number-special].","Validate the sheet with a syntax checker."],"tags":["music","yuanqin","format-exception","score-syntax","user-content"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}