This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17171 - [XQ30] try/catch syntax
Summary: [XQ30] try/catch syntax
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-24 16:09 UTC by Andrew Eisenberg
Modified: 2012-06-19 16:38 UTC (History)
2 users (show)

See Also:


Attachments

Description Andrew Eisenberg 2012-05-24 16:09:49 UTC
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
Comment 1 Jonathan Robie 2012-05-25 22:16:28 UTC
Good suggestion.
Comment 2 Jonathan Robie 2012-06-19 16:37:47 UTC
The Working Group has decided not to make this change.