Add judge action fields on_hit
and on_miss
.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Cryville.Common.Collections.Generic;
|
||||
using Cryville.Common.Pdt;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -10,11 +11,29 @@ namespace Cryville.Crtr {
|
||||
readonly List<RulesetSelector> s = new List<RulesetSelector>();
|
||||
readonly HashSet<string> a = new HashSet<string>();
|
||||
protected override object InterpretKey(Type type) {
|
||||
if (type == typeof(Constraint))
|
||||
if (PairCollection<JudgeAction, PdtExpression>.IsPairCollection(type))
|
||||
return InterpretJudgeAction();
|
||||
else if (type == typeof(Constraint))
|
||||
return InterpretConstraintKey();
|
||||
else
|
||||
return base.InterpretKey(type);
|
||||
}
|
||||
object InterpretJudgeAction() {
|
||||
a.Clear();
|
||||
while (true) {
|
||||
int pp = Position;
|
||||
switch (cc) {
|
||||
case '@':
|
||||
GetChar();
|
||||
a.Add(GetIdentifier());
|
||||
break;
|
||||
default:
|
||||
return JudgeAction.Construct(a, (string)base.InterpretKey(null));
|
||||
}
|
||||
ws();
|
||||
if (Position == pp) throw new FormatException("Invalid judge action format.");
|
||||
}
|
||||
}
|
||||
object InterpretConstraintKey() {
|
||||
s.Clear(); a.Clear();
|
||||
string key = "";
|
||||
|
Reference in New Issue
Block a user