Search in sources :

Example 1 with KeyValueValueSpecificationContext

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.KeyValueValueSpecificationContext in project legend-pure by finos.

the class FunctionExpressionProcessor method addTraceForKeyExpressions.

private void addTraceForKeyExpressions(FunctionExpression functionExpression, ProcessorSupport processorSupport) {
    ListIterable<? extends ValueSpecification> params = functionExpression._parametersValues().toList();
    if (2 < params.size()) {
        int z = 0;
        for (CoreInstance keyValue : ImportStub.withImportStubByPasses(((InstanceValue) params.get(2))._valuesCoreInstance().toList(), processorSupport)) {
            if (keyValue instanceof KeyExpression) {
                KeyValueValueSpecificationContext usageContext = (KeyValueValueSpecificationContext) processorSupport.newAnonymousCoreInstance(null, M3Paths.KeyValueValueSpecificationContext);
                usageContext._offset(z);
                usageContext._functionExpression(functionExpression);
                ValueSpecification expression = ((KeyExpression) keyValue)._expression();
                if (null != expression._usageContext()) {
                    expression._usageContextRemove();
                }
                expression._usageContext(usageContext);
            }
            z++;
        }
    }
}
Also used : KeyValueValueSpecificationContext(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.KeyValueValueSpecificationContext) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) KeyExpression(org.finos.legend.pure.m3.coreinstance.meta.pure.functions.lang.KeyExpression) ValueSpecification(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification) InstanceValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue)

Aggregations

KeyExpression (org.finos.legend.pure.m3.coreinstance.meta.pure.functions.lang.KeyExpression)1 InstanceValue (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue)1 KeyValueValueSpecificationContext (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.KeyValueValueSpecificationContext)1 ValueSpecification (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification)1 CoreInstance (org.finos.legend.pure.m4.coreinstance.CoreInstance)1