mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Reclaim "in" as an identifier
In Swift the "in" keyword is really a form of punctuation, and highly context specific punctuation at that. It never begins a statement, nor does the grammar require it be statement keyword. The grammar also doesn't use it outside of for-each loops, and its use within a for-each loop is highly unambiguous. Thanks to Chris for the performance related feedback. This improves the performance of getter/setter parsing as well. Swift SVN r3880
This commit is contained in:
@@ -353,7 +353,6 @@ void Lexer::lexIdentifier() {
|
||||
|
||||
// Statements
|
||||
.Case("if", tok::kw_if)
|
||||
.Case("in", tok::kw_in)
|
||||
.Case("else", tok::kw_else)
|
||||
.Case("for", tok::kw_for)
|
||||
.Case("do", tok::kw_do)
|
||||
|
||||
Reference in New Issue
Block a user