Skip to content

Commit aa1b9eb

Browse files
committed
fix circular dependency
1 parent c931c03 commit aa1b9eb

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/ast/mutate/commands/set/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
import { Builder } from '../../../builder';
99
import { isAssignment } from '../../../is';
10+
import { Parser } from '../../../../parser';
1011
import type {
1112
ESQLAstQueryExpression,
1213
ESQLAstSetHeaderCommand,
1314
ESQLBinaryExpression,
1415
BinaryExpressionAssignmentOperator,
1516
ESQLIdentifier,
1617
} from '../../../../types';
17-
import { synth } from '../../../../composer';
1818

1919
/**
2020
* Lists all SET header commands in the query AST.
@@ -73,10 +73,10 @@ export const update = (
7373
const cmd = findBySettingName(ast, settingName);
7474
if (!cmd) return undefined;
7575

76-
const newValueNode = synth.exp(value);
76+
const newNode = Parser.parseExpression(value).root;
7777

7878
const assignment = cmd.args[0] as ESQLBinaryExpression<BinaryExpressionAssignmentOperator>;
79-
assignment.args[1] = newValueNode;
79+
assignment.args[1] = newNode;
8080

8181
return cmd;
8282
};
@@ -100,8 +100,8 @@ export const upsert = (
100100
if (existing) return existing;
101101

102102
const identifier = Builder.identifier(settingName);
103-
const newValueNode = synth.exp(value);
104-
const assignment = Builder.expression.func.binary('=', [identifier, newValueNode]);
103+
const newNode = Parser.parseExpression(value).root;
104+
const assignment = Builder.expression.func.binary('=', [identifier, newNode]);
105105
const cmd = Builder.header.command.set([
106106
assignment as ESQLBinaryExpression<BinaryExpressionAssignmentOperator>,
107107
]);

0 commit comments

Comments
 (0)