diff --git a/OpenUtau.Core/Classic/Flags/UstFlag.cs b/OpenUtau.Core/Classic/Flags/UstFlag.cs index 81948ecab..7af74c5d4 100644 --- a/OpenUtau.Core/Classic/Flags/UstFlag.cs +++ b/OpenUtau.Core/Classic/Flags/UstFlag.cs @@ -10,5 +10,9 @@ public UstFlag(string key, int value) { Key = key ?? throw new ArgumentNullException(nameof(key)); Value = value; } + + public override string ToString() { + return Key + Value; + } } } diff --git a/OpenUtau.Core/Classic/Flags/UstFlagParser.cs b/OpenUtau.Core/Classic/Flags/UstFlagParser.cs index 2dfed5be8..45738b8f9 100644 --- a/OpenUtau.Core/Classic/Flags/UstFlagParser.cs +++ b/OpenUtau.Core/Classic/Flags/UstFlagParser.cs @@ -1,6 +1,4 @@ - -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Text; namespace OpenUtau.Classic.Flags { @@ -11,7 +9,7 @@ public IList Parse(string text) { var valueBuilder = new StringBuilder(); bool wasDigit = false; for (int i = 0; i <= text.Length; ++i) { - if (i == text.Length || char.IsLetter(text[i]) && wasDigit) { + if (i == text.Length || (char.IsLetter(text[i]) || text[i] == '/') && wasDigit) { string key = keyBuilder.ToString(); if (!int.TryParse(valueBuilder.ToString(), out int value)) { value = 0; @@ -29,7 +27,7 @@ public IList Parse(string text) { if (c == '-' || c == '+' || char.IsDigit(c)) { valueBuilder.Append(c); wasDigit = true; - } else if (char.IsLetter(c)) { + } else if (char.IsLetter(c) || c == '/') { if (keyBuilder.Length == 0 && IsSingleCharacterFlag(c)) { flags.Add(new UstFlag(c.ToString(), 0)); continue;