mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add new `-print-ast-decl` frontend option for only printing declarations, to match existing behavior. Some tests want to print the AST, but don't care about expressions. The existing `-print-ast` option now prints function bodies and expressions. Not all expressions are printed yet, but most common ones are.
19 lines
329 B
Swift
19 lines
329 B
Swift
// RUN: %target-swift-frontend -print-ast %s 2>&1 | %FileCheck %s
|
|
|
|
// CHECK-LABEL: func test() {
|
|
func test() {
|
|
log(1)
|
|
log(1.0)
|
|
log(true)
|
|
log([1, 2, 3])
|
|
log([1: true, 2: false])
|
|
}
|
|
// CHECK: log(1)
|
|
// CHECK: log(1.0)
|
|
// CHECK: log(true)
|
|
// CHECK: log([1, 2, 3])
|
|
// CHECK: log([1: true, 2: false])
|
|
|
|
func log(_ a: Any) {
|
|
}
|