mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
* Include `DeclContext` of the node where possible * Add 'default-with-decl-contexts' dump style that dumps the dect context hierarchy in addition to the AST * Support `-dump-parse` with `-dump-ast-format json`
17 lines
625 B
Swift
17 lines
625 B
Swift
// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s
|
|
// RUN: %target-swift-frontend -dump-ast -parse-as-library %s | %FileCheck %s --check-prefix=CHECK-AST
|
|
|
|
@main
|
|
struct MyBase {
|
|
static func main() throws {
|
|
}
|
|
}
|
|
|
|
// CHECK-AST: (func_decl {{.*}} implicit "$main()" interface_type="(MyBase.Type) -> () throws -> ()" access=internal static
|
|
// CHECK-AST-NEXT: (parameter "self" {{.*}})
|
|
// CHECK-AST-NEXT: (parameter_list)
|
|
// CHECK-AST-NEXT: (brace_stmt implicit
|
|
// CHECK-AST-NEXT: (return_stmt implicit
|
|
// CHECK-AST-NEXT: (try_expr implicit
|
|
// CHECK-AST-NEXT: (call_expr implicit type="()"
|