[Bug 17171] New: try/catch syntax

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17171

           Summary: try/catch syntax
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.0
        AssignedTo: jonathan.robie@gmail.com
        ReportedBy: andrew.eisenberg@us.ibm.com
         QAContact: public-qt-comments@w3.org


I've just noticed that the try/catch expression requires parens in some
circumstances.

The following are allowed:

(try {$x cast as xs:integer} catch * {1}) + 1

(try {$x cast as xs:integer} catch * {1}) eq 1

Remove the parens and these expressions do not parse.

This comes about because we placed TryCatchExpr in ExprSingle:

[40]  ExprSingle  ::= FLWORExpr
                      | QuantifiedExpr
                      | SwitchExpr
                      | TypeswitchExpr
                      | IfExpr
                      | TryCatchExpr
                      | OrExpr

Perhaps it would be better located in ValueExpr:

[96] ValueExpr    ::=  ValidateExpr | PathExpr | ExtensionExpr

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 24 May 2012 16:10:01 UTC