Skip to content

Commit

Permalink
Don't try to match unselected dancers with 'select' clauses.
Browse files Browse the repository at this point in the history
  • Loading branch information
cscott committed May 16, 2014
1 parent 1ec4ccd commit 0a1cfb5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/net/cscott/sdr/calls/Evaluator.java
Expand Up @@ -404,7 +404,7 @@ public Evaluator visit(Par p, DanceState ds) {
TaggedFormation tf = TaggedFormation.coerce(f);
// we're going to want to ensure that every dancer matches
// some tag.
Set<Dancer> unmatched = new LinkedHashSet<Dancer>(f.dancers());
Set<Dancer> unmatched = new LinkedHashSet<Dancer>(f.selectedDancers());
PartsCombineEvaluator pce = new PartsCombineEvaluator();
for (ParCall pc : p.children) {
// find the dancers matched, adjusting unmatched set
Expand All @@ -417,7 +417,9 @@ public Evaluator visit(Par p, DanceState ds) {
}
// all dancers must match a part.
if (!unmatched.isEmpty())
throw new BadCallException("Some dancers are not matched");
throw new BadCallException("Some dancers are not matched "+
"(for example, " +
unmatched.iterator().next()+")");
// ok, now do one step of the evaluation.
return pce.evaluate(ds);
}
Expand Down

0 comments on commit 0a1cfb5

Please sign in to comment.