private void CompileKeys()
{
CheckSingletonFocus();
for (int idx = 0; idx < _compiler.Keys.Count; idx++)
{
foreach (Key key in _compiler.Keys[idx])
{
EnterScope(key);
QilParameter context = _f.Parameter(T.NodeNotRtf);
_singlFocus.SetFocus(context);
QilIterator values = _f.For(_f.OptimizeBarrier(CompileKeyMatch(key.Match)));
_singlFocus.SetFocus(values);
QilIterator keys = _f.For(CompileKeyUse(key));
keys = _f.For(_f.OptimizeBarrier(_f.Loop(keys, _f.ConvertToString(keys))));
QilParameter value = _f.Parameter(T.StringX);
QilFunction func = _f.Function(_f.FormalParameterList(context, value),
_f.Filter(values,
_f.Not(_f.IsEmpty(_f.Filter(keys, _f.Eq(keys, value))))
),
_f.False()
);
func.DebugName = key.GetDebugName();
SetLineInfo(func, key.SourceLine);
key.Function = func;
_functions.Add(func);
ExitScope();
}
}
_singlFocus.SetFocus(null);
}