/
krasninja
/
querycat
Обзор
Документация
Войти
/
krasninja
/
querycat
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/QueryCat.Backend/Commands/Select/SelectPlanner.Misc.cs
33 строки
1 KB
Ivan Kozhin
Replace CommandHandler by IFuncUnit
29 дек 2023, 07:41
29 дек 2023, 07:41
6ad0b9d
Код
Авторство
О чём код?
using QueryCat.Backend.Ast; using QueryCat.Backend.Ast.Nodes.Select; using QueryCat.Backend.Commands.Select.Visitors; namespace QueryCat.Backend.Commands.Select; internal sealed partial class SelectPlanner { private IFuncUnit Misc_CreateDelegate(IAstNode node, SelectCommandContext? context = null) { if (context != null) { return new SelectCreateDelegateVisitor(ExecutionThread, context).RunAndReturn(node); } else { return new CreateDelegateVisitor(ExecutionThread).RunAndReturn(node); } } private IEnumerable<IFuncUnit> Misc_CreateDelegate(IEnumerable<IAstNode> nodes, SelectCommandContext? context = null) { var visitor = context != null ? new SelectCreateDelegateVisitor(ExecutionThread, context) : new CreateDelegateVisitor(ExecutionThread); return nodes.Select(n => visitor.RunAndReturn(n)); } private void Misc_Transform(SelectQueryNode node) { new TransformQueryAstVisitor().Run(node); } }