[Bug 1387] New: [XQuery] some editorial comments on A.2.3 Comments

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1387

           Summary: [XQuery] some editorial comments on A.2.3 Comments
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: jmdyck@ibiblio.org
         QAContact: public-qt-comments@w3.org


A.2.3 Comments

(whole section)
    I think the content of this section should be moved/merged either to A.1.1
    grammar-note: comments, or 2.6 Comments.  It appears to be just talking
    about ramifications of the Comment and CommentContents productions.  It
    isn't specifying the lexical structure of the language.

"Comments are allowed to nest, though the content of a comment must have
balanced comment delimiters without regard to structure."
    I'm not sure that "balanced delimiters without regard to structure" makes
    any sense. Doesn't "balanced" induce a structure? Would "balanced delimiters
    *with* regard to structure" or just "balanced delimiters" mean something
    different?

    And anyway, aren't balanced delimiters guaranteed by the fact that comments
    nest? In which case, "though" should be "so".

"It is a limitation of nested comments that literal content can cause unbalanced
nesting of comments."
    Comments don't have to nest to cause problems like this, they just have to
    have visible delimiters (as opposed to line-end comments): if you have a
    language with delimited comments, and you try to comment-out a chunk of
    text, there's the possibility that the text might already contain characters
    that are (or will become) a comment delimiter and screw things up.

    E.g., in C (where comments are delimited but do not nest),
        "this is just a string */"
    is a legal expression. But
        /* "this is just a string */" */
    will cause a syntax error. Mind you,
        /* "this is just a string /*" */
    isn't an error (unlike the corresponding construct in XQuery), though it'll
    probably get you a warning.

Received on Wednesday, 11 May 2005 07:40:58 UTC