use of org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.SignedExpressionContext in project legend-pure by finos.
the class AntlrContextToM3CoreInstance method signedExpression.
private SimpleFunctionExpression signedExpression(SignedExpressionContext ctx, String exprName, MutableList<String> typeParametersNames, LambdaContext lambdaContext, String space, ImportGroup importId, boolean addLines) {
CoreInstance number;
SimpleFunctionExpression result;
if (ctx.MINUS() != null) {
number = this.expression(ctx.expression(), exprName, typeParametersNames, lambdaContext, space, true, importId, addLines);
result = SimpleFunctionExpressionInstance.createPersistent(this.repository, this.sourceInformation.getPureSourceInformation(ctx.MINUS().getSymbol()), null, null, importId, null);
result._functionName("minus");
result._parametersValues(Lists.mutable.of((ValueSpecification) number));
} else {
number = this.expression(ctx.expression(), exprName, typeParametersNames, lambdaContext, space, true, importId, addLines);
result = SimpleFunctionExpressionInstance.createPersistent(this.repository, this.sourceInformation.getPureSourceInformation(ctx.PLUS().getSymbol()), null, null, importId, null);
result._functionName("plus");
result._parametersValues(Lists.mutable.of((ValueSpecification) number));
}
return result;
}
Aggregations