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:
Dave Zarzycki
2013-01-26 01:49:18 +00:00
parent 6cfcb412b3
commit d7cc4b4a91
7 changed files with 13 additions and 31 deletions

View File

@@ -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)