-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
fhirpathRelated to fhirpath reference implementationRelated to fhirpath reference implementationrefactoringImproving the design of existing codeImproving the design of existing code
Description
Encapsulate operator resolution in the manner similar to function resolution.
Decide when do perform the operator resolution (maybe should be at execution time same as for functions)
or maybe the functions should be resolved at parse time as well.
See: Visitor
:
// TODO: encapsulate in operator resolver
// Decide when do perform the operator resolution (maybe should be at execution time same as for functions)
// or maybe the functions should be resolved at parse time as well.
private static final Map<String, BinaryOperator> BINARY_OPERATORS = MethodDefinedOperator.mapOf(
CollectionOperations.class);
@Nonnull
private FhirPath visitBinaryOperator(
@Nullable final ParseTree leftContext,
@Nullable final ParseTree rightContext, @Nullable final String operatorName) {
requireNonNull(operatorName);
return new EvalOperator(new Visitor().visit(leftContext),
new Visitor().visit(rightContext),
Optional.ofNullable(BINARY_OPERATORS.get(operatorName))
.orElseGet(() -> BinaryOperatorType.fromSymbol(operatorName).getInstance()));
Metadata
Metadata
Assignees
Labels
fhirpathRelated to fhirpath reference implementationRelated to fhirpath reference implementationrefactoringImproving the design of existing codeImproving the design of existing code
Type
Projects
Status
Backlog