Reads score operation as structure.
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using SIdentifier = Cryville.Common.Identifier;
|
||||
|
||||
namespace Cryville.Crtr {
|
||||
@@ -163,6 +164,13 @@ namespace Cryville.Crtr {
|
||||
if (type.Equals(typeof(Identifier))) {
|
||||
return (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 base.ChangeType(value, type, culture);
|
||||
}
|
||||
|
Reference in New Issue
Block a user