Skip to content

Commit

Permalink
Another
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonF committed Mar 25, 2024
1 parent 6fe5d49 commit e3f640a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/generate/src/syntax/toEdgeQL.ts
Expand Up @@ -932,13 +932,15 @@ function renderEdgeQL(
expr.__element__.__name__ === "std::number"
? "std::float64"
: expr.__element__.__name__;
let inner = "{}";
if (expr.__expr__) {
const isCast = (expr.__expr__ as any).__kind__ === ExpressionKind.Cast;
const innerExpr = renderEdgeQL(expr.__expr__, ctx);
inner = isCast ? innerExpr.slice(1, -1) : innerExpr;
if (!expr.__expr__) {
return `<${typeName}>{}`;
}
return `(<${typeName}>${inner})`;
const innerExpr = renderEdgeQL(expr.__expr__, ctx);
const isCast =
(expr.__expr__ as any).__kind__ === ExpressionKind.Cast &&
innerExpr[0] === "(";
const expr = isCast ? innerExpr.slice(1, -1) : innerExpr;
return `(<${typeName}>${expr})`;
} else if (expr.__kind__ === ExpressionKind.Select) {
const lines: string[] = [];
if (isObjectType(expr.__element__)) {
Expand Down

0 comments on commit e3f640a

Please sign in to comment.