Skip to content

Commit

Permalink
Build deno [autogenerated commit]
Browse files Browse the repository at this point in the history
  • Loading branch information
oguimbal committed Aug 6, 2024
1 parent aa61ba7 commit 47eca26
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
39 changes: 17 additions & 22 deletions .deno/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class Evaluator<T = any> implements IValue<T> {
}

get isConstant(): boolean {
return !this.usedColumns.size && !this.forceNotConstant;
return !this.usedColumns.size && !this.forceNotConstant || !!this.opts?.actAsConstantLiteral;
}

get isConstantReal(): boolean {
Expand All @@ -51,29 +51,24 @@ export class Evaluator<T = any> implements IValue<T> {
}

// fetch columns to depend on
let depArray: IValue[] | undefined = undefined;
let depArray: IValue[] | nil = dependencies && !Array.isArray(dependencies)
? [dependencies]
: dependencies;
let hasNotConstant = false;
if (dependencies) {
if (!Array.isArray(dependencies)) {
depArray = [dependencies];
this.usedColumns = dependencies.usedColumns as Set<IValue>;
hasNotConstant = !dependencies.isConstant;
this.origin = dependencies.origin;
} else {
this.usedColumns = new Set();
for (const d of dependencies) {
if (d.origin) {
if (this.origin && d.origin && this.origin !== d.origin) {
throw new Error('You cannot evaluate an expression which is coming from multiple origins');
}
this.origin = d.origin;
}
if (!d.isConstant) {
hasNotConstant = true;
}
for (const u of d.usedColumns) {
this.usedColumns.add(u);
if (depArray) {
this.usedColumns = new Set();
for (const d of depArray) {
if (d.origin) {
if (this.origin && d.origin && this.origin !== d.origin) {
throw new Error('You cannot evaluate an expression which is coming from multiple origins');
}
this.origin = d.origin;
}
if (!d.isConstant) {
hasNotConstant = true;
}
for (const u of d.usedColumns) {
this.usedColumns.add(u);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions .deno/parser/expression-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function _buildValueReal(val: Expr): IValue {
, {
forceNotConstant: true,
actAsConstantLiteral: true,
unpure: true,
onCast: toType => {
// register the type of the parameter
setParameterType(idx, toType);
Expand Down

0 comments on commit 47eca26

Please sign in to comment.