Project

Profile

Help

Revision f7dc848d

Added by Michael Kay over 10 years ago

Fix bug 3181942 Function calls with placeholders

View differences:

latest9.3/hej/net/sf/saxon/expr/ExpressionParser.java
2100 2100
        Expression[] arguments = new Expression[args.size()];
2101 2101
        args.toArray(arguments);
2102 2102

  
2103
        if (placeMarkers != null) {
2104
            return makeCurriedFunction(functionName, arguments, placeMarkers);
2105
        }
2106

  
2103 2107
        Expression fcall;
2104 2108
        try {
2105 2109
            fcall = env.getFunctionLibrary().bind(functionName, arguments, env, defaultContainer);
......
2196 2200
            fcall.adoptChildExpression(arguments[a]);
2197 2201
        }
2198 2202

  
2199
        if (placeMarkers != null) {
2200
            return makeCurriedFunction((FunctionCall)fcall, arguments, placeMarkers);
2201
        }
2202

  
2203 2203
        return makeTracer(offset, fcall, Location.FUNCTION_CALL, functionName);
2204 2204

  
2205 2205
    }
......
2285 2285
    /**
2286 2286
     * Process a function call in which one or more of the argument positions are
2287 2287
     * represented as "?" placemarkers (indicating partial application or currying)
2288
     * @param fcall the function call (as if there were no currying)
2288
     * @param name the function name
2289 2289
     * @param args the arguments (with EmptySequence in the placemarker positions)
2290
     * @param placeMarkers  the positions of the placemarkers
2291
     * @return the curried function
2290
     * @param placeMarkers  the positions of the placemarkers   @return the curried function
2292 2291
     * @throws XPathException
2293 2292
     */
2294 2293

  
2295 2294
    protected Expression makeCurriedFunction(
2296
            FunctionCall fcall, Expression[] args, IntSet placeMarkers)
2295
            StructuredQName name, Expression[] args, IntSet placeMarkers)
2297 2296
            throws XPathException {
2298
        grumble("Curried functions are allowed only in XQuery 1.1");
2297
        grumble("Curried functions are allowed only in XPath/XQuery 3.0");
2299 2298
        return null;
2300 2299
    }
2301 2300

  

Also available in: Unified diff