Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add correct source location info to rewritten range functions.

  • Loading branch information...
commit 50318c29205d6fac994d272b1b6a4a37e982ce20 1 parent 68d5003
Wolfgang Meier wolfgangmm authored
6 extensions/indexes/range/src/org/exist/xquery/modules/range/RangeQueryRewriter.java
View
@@ -100,7 +100,8 @@ public boolean rewriteLocationStep(LocationStep locationStep) throws XPathExcept
ArrayList<Expression> eqArgs = new ArrayList<Expression>(2);
eqArgs.add(comparison.getLeft());
eqArgs.add(comparison.getRight());
- Lookup func = new Lookup(getContext(), Lookup.signatures[0]);
+ Lookup func = new Lookup(comparison.getContext(), Lookup.signatures[0]);
+ func.setLocation(comparison.getLine(), comparison.getColumn());
func.setArguments(eqArgs);
pred.replace(comparison, new InternalFunctionCall(func));
}
@@ -118,7 +119,8 @@ public boolean rewriteLocationStep(LocationStep locationStep) throws XPathExcept
// the entire filter expression can be replaced
RewritableExpression parent = (RewritableExpression) parentExpr;
// create range:field-equals function
- FieldLookup func = new FieldLookup(getContext(), FieldLookup.signatures[0]);
+ FieldLookup func = new FieldLookup(locationStep.getContext(), FieldLookup.signatures[0]);
+ func.setLocation(locationStep.getLine(), locationStep.getColumn());
func.setArguments(args);
parent.replace(locationStep, new InternalFunctionCall(func));
Please sign in to comment.
Something went wrong with that request. Please try again.