[oXygen-user] "Lexical error" in applying Format & Indent to XQuery
Joe Wicentowski
joewiz at gmail.com
Fri Jul 29 12:34:05 CDT 2022
Dear oXygen Support,
I encountered an unexpected error today when applying "Format & Indent" to
a valid XQuery file. The error is:
Cannot format the document. Lexical error at line 21, column 33.
> Encountered: "]" (93), after : ""
The XQuery is as follows, and line 21, column 33 corresponds to the nested
array constructors [[]] :
*xquery version* "3.1";
>
> *declare namespace* *array*="http://www.w3.org/2005/xpath-functions/array"
> ;
>
> *let* *$permArray* := *function*(*$myAr* *as* *array*(*))
> {
> *let* *$extend* := *function*(*$ar* *as* *array*(*), *$mem* *as* *item*
> ()*)
> {
> *array*{
> *for* *$i* *in* 1 *to* (*array:size*(*$ar*) +1)
> *return*
> *array:insert-before*(*$ar*, *$i*, *$mem*)
> }
> },
> *$extendAllSubArrays* := *function*(*$zero* *as* *array*(*), *$mem*
> *as* *item*()*)
> {
> *array:join*(
> *for* *$i* *in* 1 *to*
> *array:size*(*$zero*)
> *return* *$extend*(*$zero*(
> *$i*), *$mem*)
> )
> }
> *return*
> *array:fold-left*(*$myAr*, [[]], *$extendAllSubArrays*)
> }
> *return* *$permArray*([1, 2, 3]) => *serialize*(*map* { *"method"*: "json"
> })
>
The query was shared on the XML.com Slack at
https://xmlcom.slack.com/archives/C011NLXE4DU/p1659114945879269?thread_ts=1658881670.454309&cid=C011NLXE4DU
.
Using the XQuery debugger, oXygen returns the expected results:
[[3,2,1],[2,3,1],[2,1,3],[3,1,2],[1,3,2],[1,2,3]]
But for some reason oXygen is unable to perform "format & indent" on the
source XQuery. Could you please investigate this "lexical error"?
Thank you,
Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20220729/4d136b46/attachment.htm>
More information about the oXygen-user
mailing list