[XQuery] Lexical rules for comment, pi, cdata

In section A.2.2 Lexical Rules, "<!--", "<?" and "<![CDATA[" go to 
XML_COMMENT, PROCESSING_INSTRUCTION, and CDATA_SECTION respectively 
with pushState(). The direct element constructor "<" goes to START_TAG 
with pushState(OPERATOR)

Since the OPERATOR state is not pushed for comments, pis, and cdata, 
the following is illegal:
let $a := <!-- foo -->
return $a

whereas
let $a := (<!-- foo -->)
behaves correctly.

We suggest changing "<!--", "<?", and "<![CDATA" to push the OPERATOR 
state so the parentheses are not necessary.

--Sarah

Received on Friday, 23 January 2004 16:09:16 UTC