Files
swift-mirror/include/swift/AST/PatternNodes.def
John McCall 16f8b2e656 Revise the language design for function argument clause syntax.
A function argument clause is now one or more patterns (which
must be parenthesized and explicitly type all positions) not
separated by arrows;  the first arrow then separates off the
return type.

Revisions to language reference forthcoming.



Swift SVN r1099
2012-01-26 01:25:26 +00:00

31 lines
1.0 KiB
C++

//===--- PatternNodes.def - Swift Pattern AST Metaprogramming ---*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines macros used for macro-metaprogramming with patterns.
//
//===----------------------------------------------------------------------===//
/// PATTERN(Id, Parent)
/// The pattern's enumerator value is PatternKind::Id. The pattern's
/// class name is Id##Pattern, and the name of its base class is Parent.
#ifndef PATTERN
#error Included PatternNodes.def without defining PATTERN!
#endif
PATTERN(Paren, Pattern)
PATTERN(Tuple, Pattern)
PATTERN(Named, Pattern)
PATTERN(Any, Pattern)
PATTERN(Typed, Pattern)
#undef PATTERN