Skip to content

Commit 0c9bc8a

Browse files
committed
---
yaml --- r: 346751 b: refs/heads/master c: 3f1840c h: refs/heads/master i: 346749: c54cd9e 346747: 10f2e45 346743: 697c47e 346735: 6673656 346719: c1025fd 346687: 44ccaa5 346623: c66eaba
1 parent c6ba86a commit 0c9bc8a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 53c6ec8b6bbc9a411f3433ee396d72ab7dff1ec9
2+
refs/heads/master: 3f1840c0e643d441fde742ea0c55ffd210aa3604
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/IDE/SyntaxModel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ SyntaxModelContext::SyntaxModelContext(SourceFile &SrcFile)
6767
Optional<unsigned> Length;
6868
if (AttrLoc.isValid()) {
6969
// This token is following @, see if it's a known attribute name.
70+
// Type attribute, decl attribute, or '@unknown' for swift case statement.
7071
if (TypeAttributes::getAttrKindFromString(Tok.getText()) != TAK_Count ||
71-
DeclAttribute::getAttrKindFromString(Tok.getText()) != DAK_Count) {
72+
DeclAttribute::getAttrKindFromString(Tok.getText()) != DAK_Count ||
73+
Tok.getText() == "unknown") {
7274
// It's a known attribute, so treat it as a syntactic attribute node for
7375
// syntax coloring. If swift gets user attributes then all identifiers
7476
// will be treated as syntactic attribute nodes.

trunk/test/IDE/coloring.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ func keywordInCaseAndLocalArgLabel(_ for: Int, for in: Int, class _: Int) {
377377
case (let x, let y):
378378
// CHECK: <kw>case</kw> (<kw>let</kw> x, <kw>let</kw> y):
379379
print(x, y)
380+
@unknown default:
381+
// CHECK: <attr-id>@unknown</attr-id> <kw>default</kw>:
382+
()
380383
}
381384
}
382385

0 commit comments

Comments
 (0)