Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions OpenUtau.Core/Classic/Flags/UstFlag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
8 changes: 3 additions & 5 deletions OpenUtau.Core/Classic/Flags/UstFlagParser.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;

namespace OpenUtau.Classic.Flags {
Expand All @@ -11,7 +9,7 @@ public IList<UstFlag> 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;
Expand All @@ -29,7 +27,7 @@ public IList<UstFlag> 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;
Expand Down
Loading