Files
swift-mirror/test/Syntax/tokens_nul.swift
Xi Ge 94c3f55117 libSyntax: extract meta-information of trivia kinds to syntax_gyb_support. NFC
The existing libSyntax infrastructure uses external python
dictionaries to share logic between C++ and Swift implementations.
This patch teaches trivia kinds to adapt to this infrastructure
 as well.
2018-03-06 17:45:43 -08:00

29 lines
891 B
Swift

// RUN: cat %s | tr '\132' '\0' > %t.tmp
// RUN: cp -f %t.tmp %t
// RUN: %swift-syntax-test -input-source-filename %t -dump-full-tokens 2>&1 | %FileCheck %t
let a = Z3Z // nul(Z)
func b() {}
// CHECK: 4:9: warning: nul character embedded in middle of file
// CHECK: 4:11: warning: nul character embedded in middle of file
// CHECK: 4:20: warning: nul character embedded in middle of file
// CHECK-LABEL: 4:7
// CHECK-NEXT:(Token equal
// CHECK-NEXT: (text="=")
// CHECK-NEXT: (trivia space 1)
// CHECK-NEXT: (trivia garbageText \000))
// CHECK-LABEL: 4:10
// CHECK-NEXT:(Token integer_literal
// CHECK-NEXT: (text="3")
// CHECK-NEXT: (trivia garbageText \000)
// CHECK-NEXT: (trivia space 1))
// CHECK-LABEL: 5:1
// CHECK-NEXT:(Token kw_func
// CHECK-NEXT: (trivia lineComment // nul(\000))
// CHECK-NEXT: (trivia newline 1)
// CHECK-NEXT: (text="func")
// CHECK-NEXT: (trivia space 1))