Skip to content

Commit b57fed7

Browse files
gabriele-tomassettiadamretter
authored andcommitted
[feature] Add parsing support for delete expression
1 parent d5e49dc commit b57fed7

File tree

1 file changed

+13
-7
lines changed
  • exist-core/src/main/antlr/org/exist/xquery/parser

1 file changed

+13
-7
lines changed

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ exprSingle throws XPathException
722722
| ( "typeswitch" LPAREN ) => typeswitchExpr
723723
| ( "update" ( "replace" | "value" | "insert" | "delete" | "rename" )) => updateExpr
724724
| ( "insert" ) => xqufInsertExpr
725+
| ( "delete" ) => xqufDeleteExpr
725726
| ( "copy" DOLLAR) => copyModifyExpr
726727
| ( "invoke" "updating" ) => dynamicUpdFunCall
727728
| orExpr
@@ -757,6 +758,16 @@ insertExpr throws XPathException
757758
( "into" | "preceding" | "following" ) exprSingle
758759
;
759760
761+
deleteExpr throws XPathException
762+
:
763+
"delete" exprSingle
764+
;
765+
766+
renameExpr throws XPathException
767+
:
768+
"rename" exprSingle "as"! exprSingle
769+
;
770+
760771
xqufInsertExpr throws XPathException
761772
:
762773
"insert"^ ( "node"! | "nodes"! ) exprSingle
@@ -778,14 +789,9 @@ insertExprTargetChoice throws XPathException
778789
779790
;
780791
781-
deleteExpr throws XPathException
782-
:
783-
"delete" exprSingle
784-
;
785-
786-
renameExpr throws XPathException
792+
xqufDeleteExpr throws XPathException
787793
:
788-
"rename" exprSingle "as"! exprSingle
794+
"delete"^ ( "node"! | "nodes"! ) exprSingle
789795
;
790796
791797
copyModifyExpr throws XPathException

0 commit comments

Comments
 (0)