mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SE-0276] Implement multi-pattern catch clauses
Like switch cases, a catch clause may now include a comma- separated list of patterns. The body will be executed if any one of those patterns is matched. This patch replaces `CatchStmt` with `CaseStmt` as the children of `DoCatchStmt` in the AST. This necessitates a number of changes throughout the compiler, including: - Parser & libsyntax support for the new syntax and AST structure - Typechecking of multi-pattern catches, including those which contain bindings. - SILGen support - Code completion updates - Profiler updates - Name lookup changes
This commit is contained in:
@@ -244,6 +244,8 @@ SYNTAX_NODE_SERIALIZATION_CODES = {
|
||||
'PoundFilePathExpr': 240,
|
||||
'DerivativeRegistrationAttributeArguments': 241,
|
||||
'QualifiedDeclName': 242,
|
||||
'CatchItem': 243,
|
||||
'CatchItemList': 244,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user