private String getNumberAsString(OperatorNode<ExpressionOperator> ast) {
        String negative = "";
        if (ast.getOperator() == ExpressionOperator.NEGATE) {
            negative = "-";
            ast = ast.getArgument(0);
        }
        return switch (ast.getOperator()) {
            case VARREF -> {
                Preconditions.checkState(userQuery != null,
                        "properties must be available when trying to fetch user input");
                yield negative + userQuery.properties().getString(ast.getArgument(0, String.class));
            }
            case LITERAL -> negative + ast.getArgument(0).toString();
            default -> throw new IllegalArgumentException("Expected VARREF or LITERAL, got " + ast.getOperator());
        };
    }
The YQL query language.

This class <em>must</em> be kept in lockstep with {@link VespaSerializer}.
Adding anything here will usually require a corresponding addition in
VespaSerializer.

@author Steinar Knutsen
@author Stian Kristoffersen
@author Simon Thoresen Hult
container-search/src/main/java/com/yahoo/search/yql/YqlParser.java