Add constructors for ScoreOperation.

This commit is contained in:
2023-05-20 16:15:12 +08:00
parent 3d75cd9a11
commit 6ccc86c28d
2 changed files with 11 additions and 5 deletions

View File

@@ -52,11 +52,7 @@ namespace Cryville.Crtr {
return new Identifier(exp);
}
else if (type == typeof(ScoreOperation)) {
var m = Regex.Match(exp, @"^(\S+)\s*?(\S+)?$");
var name = new Identifier(m.Groups[1].Value);
if (!m.Groups[2].Success) return new ScoreOperation { name = name };
var op = new Identifier(m.Groups[2].Value);
return new ScoreOperation { name = name, op = op };
return new ScoreOperation(exp);
}
}
return base.ChangeType(value, type, culture);