Make mask parser create world-aware expression masks.

This allows things like //gmask =queryRel(...) to work.
Also the query* functions now allow -1 as a wildcard for either id or data.
This commit is contained in:
wizjany
2016-01-13 17:34:58 -05:00
parent 23d6fa7579
commit 2cd4412b5d
2 changed files with 10 additions and 2 deletions

View File

@ -442,7 +442,9 @@ public final class Functions {
private static double queryInternal(RValue type, RValue data, double typeId, double dataValue) throws EvaluationException {
// Compare to input values and determine return value
final double ret = (typeId == type.getValue() && dataValue == data.getValue()) ? 1.0 : 0.0;
// -1 is a wildcard, always true
final double ret = ((type.getValue() == -1 || typeId == type.getValue())
&& (data.getValue() == -1 || dataValue == data.getValue())) ? 1.0 : 0.0;
if (type instanceof LValue) {
((LValue) type).assign(typeId);