use of org.kie.dmn.feel.lang.ast.AtLiteralNode.TypeAndFn in project drools by kiegroup.
the class ASTCompilerVisitor method visit.
@Override
public DirectCompilerResult visit(AtLiteralNode n) {
DirectCompilerResult stringLiteral = n.getStringLiteral().accept(this);
String value = ((StringLiteralExpr) stringLiteral.getExpression()).asString();
TypeAndFn typeAndFn = AtLiteralNode.fromAtValue(value);
String functionName = typeAndFn.fnName;
Type resultType = typeAndFn.type;
if (resultType == BuiltInType.UNKNOWN) {
return DirectCompilerResult.of(CompiledFEELSupport.compiledErrorExpression(Msg.createMessage(Msg.MALFORMED_AT_LITERAL, n.getText())), BuiltInType.UNKNOWN);
}
return DirectCompilerResult.of(Expressions.invoke(FeelCtx.getValue(functionName), stringLiteral.getExpression()), resultType).withFD(stringLiteral);
}
Aggregations