Skip to content

Commit 391afe9

Browse files
gabriele-tomassettiadamretter
authored andcommitted
[feature] Add handling of intermediate AST for rename expression
1 parent 7481ee1 commit 391afe9

File tree

1 file changed

+24
-0
lines changed
  • exist-core/src/main/antlr/org/exist/xquery/parser

1 file changed

+24
-0
lines changed

exist-core/src/main/antlr/org/exist/xquery/parser/XQueryTree.g

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,6 +2202,8 @@ throws PermissionDeniedException, EXistException, XPathException
22022202
|
22032203
step=xqufReplaceExpr [path]
22042204
|
2205+
step=xqufRenameExpr [path]
2206+
|
22052207
step=transformWithExpr [path]
22062208
|
22072209
step=copyModifyExpr [path]
@@ -3983,6 +3985,28 @@ throws XPathException, PermissionDeniedException, EXistException
39833985
)
39843986
;
39853987

3988+
xqufRenameExpr [PathExpr path]
3989+
returns [Expression step]
3990+
throws XPathException, PermissionDeniedException, EXistException
3991+
{
3992+
}:
3993+
#(
3994+
renameAST:"rename"
3995+
{
3996+
PathExpr target = new PathExpr(context);
3997+
PathExpr newName = new PathExpr(context);
3998+
}
3999+
step=expr [target]
4000+
step=expr [newName]
4001+
{
4002+
RenameExpr renameExpr = new RenameExpr(context, target, newName);
4003+
renameExpr.setASTNode(renameAST);
4004+
path.add(renameExpr);
4005+
step = renameExpr;
4006+
}
4007+
)
4008+
;
4009+
39864010
mapConstr [PathExpr path]
39874011
returns [Expression step]
39884012
throws XPathException, PermissionDeniedException, EXistException

0 commit comments

Comments
 (0)