mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Extend the character set for identifiers according to WG14 N1518, which recommends an extended character set for identifier start and continuation characters in C. Mangle identifiers containing non-ASCII characters by borrowing the Punycode encoding used for international domain names. No Unicode operators just yet. Swift SVN r4968
25 lines
739 B
Swift
25 lines
739 B
Swift
// RUN: %swift -parse -verify %s
|
||
|
||
class 你好 {
|
||
class שלום {
|
||
class வணக்கம் {
|
||
class Γειά {
|
||
static func привет() {
|
||
println("hello")
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
你好.שלום.வணக்கம்.Γειά.привет()
|
||
|
||
// Identifiers cannot start with combining chars.
|
||
.́duh() // expected-error{{an identifier cannot begin with this character}} //expected-error{{an identifier cannot begin with this character}} //expected-error{{expected identifier after '.' expression}}
|
||
|
||
// Combining characters can be used within identifiers.
|
||
func s̈pin̈al_tap̈() {}
|
||
|
||
// Private-use characters aren't valid in Swift source.
|
||
() // expected-error{{invalid character in source file}}
|