Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into feature/execution-cons…
Browse files Browse the repository at this point in the history
…traint-executor-tests
  • Loading branch information
f3l1x98 committed Aug 28, 2023
2 parents 95f81a7 + 1766715 commit dd02a09
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions libs/execution/src/lib/execution-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import {
ConstraintDefinition,
EvaluationContext,
InternalValueRepresentation,
MetaInformation,
PipelineDefinition,
PropertyAssignment,
TransformDefinition,
Valuetype,
evaluatePropertyValue,
getOrFailMetaInformation,
isConstraintDefinition,
isExpressionConstraintDefinition,
isPipelineDefinition,
isPropertyBody,
Expand Down Expand Up @@ -125,13 +127,7 @@ export class ExecutionContext {
propertyName: string,
valuetype: Valuetype<I>,
): I {
const currentNode = this.getCurrentNode();
assert(!isPipelineDefinition(currentNode));
assert(!isExpressionConstraintDefinition(currentNode));
assert(!isTransformDefinition(currentNode));
assert(isReference(currentNode.type));

const metaInf = getOrFailMetaInformation(currentNode.type);
const metaInf = this.getMetaInformationOfCurrentNode();
const propertySpec = metaInf.getPropertySpecification(propertyName);
assert(propertySpec !== undefined);

Expand All @@ -141,4 +137,20 @@ export class ExecutionContext {

return defaultValue;
}

private getMetaInformationOfCurrentNode() {
const currentNode = this.getCurrentNode();
assert(!isPipelineDefinition(currentNode));
assert(!isExpressionConstraintDefinition(currentNode));
assert(!isTransformDefinition(currentNode));

let metaInf: MetaInformation;
if (isConstraintDefinition(currentNode)) {
metaInf = getOrFailMetaInformation(currentNode.type);
} else {
assert(isReference(currentNode.type));
metaInf = getOrFailMetaInformation(currentNode.type);
}
return metaInf;
}
}

0 comments on commit dd02a09

Please sign in to comment.