private ExpressionNode transformConstantReference(ReferenceNode node, TransformContext context) {
        String name = node.getName();
        if (node.reference().name().equals("constant")) {
            ExpressionNode arg = node.getArguments().expressions().get(0);
            if (arg instanceof ReferenceNode) {
                name = ((ReferenceNode)arg).getName();
            }
        }
        Value value = context.constants().get(name);  // works if "constant(...)" is added
        if (value == null || value.type().rank() > 0) {
            return node; // not a number constant reference
        }
        return new ConstantNode(value.freeze());
    }
Returns true if the given reference is an attribute, constant or query feature
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/transform/ConstantDereferencer.java