Files
swift-mirror/test/Parse/identifiers.swift
Joe Groff 1013781bcc Parse: Allow Unicode identifier characters.
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
2013-04-28 21:39:02 +00:00

25 lines
739 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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}}