/
krasninja
/
querycat
Обзор
Документация
Войти
/
krasninja
/
querycat
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/QueryCat.Backend/Commands/Declare/SetCommand.cs
26 строк
838 B
Ivan Kozhin
Add ability to set value to object expression
13 апр 2024, 10:28
13 апр 2024, 10:28
893f8d8
Код
Авторство
О чём код?
using QueryCat.Backend.Ast.Nodes; using QueryCat.Backend.Ast.Nodes.Declare; using QueryCat.Backend.Core.Execution; using QueryCat.Backend.Core.Types; namespace QueryCat.Backend.Commands.Declare; internal sealed class SetCommand : ICommand { /// <inheritdoc /> public IFuncUnit CreateHandler(IExecutionThread<ExecutionOptions> executionThread, StatementNode node) { var setNode = (SetNode)node.RootNode; var valueHandler = new StatementsVisitor(executionThread) .RunAndReturn(setNode.ValueNode); var identifierHandler = new SetIdentifierDelegateVisitor(executionThread, valueHandler) .RunAndReturn(setNode.IdentifierNode); return new FuncCommandHandler(() => { identifierHandler.Invoke(); return VariantValue.Null; }); } }