[syntax-map] Fix array-of-object-literal syntax map, argument label keywords

Argument labels are allowed to use keywords, in which case we want to
treat them as identifiers in the syntax map (except for '_'). This
commit moves calculation of that into the original lexing instead of
in the model walker, which makes it much more robust, since the model
walker was only guessing about what was next on the the TokenNodes list.

This fixes a bug where arrays of object literals would only have the
first object correct (the following ones were identifiers), as well as
some incorrect cases where we treated keywords as identifiers.

rdar://problem/27726422
This commit is contained in:
Ben Langmuir
2016-08-09 10:18:11 -07:00
parent a6f3eb18c5
commit 74113f92ce
3 changed files with 43 additions and 15 deletions

View File

@@ -29,7 +29,7 @@
key.length: 40
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 165,
key.length: 3
},
@@ -44,7 +44,7 @@
key.length: 50
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 228,
key.length: 3
},