OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 KEYWORD_GROUP('w') \ | 881 KEYWORD_GROUP('w') \ |
882 KEYWORD("while", Token::WHILE) \ | 882 KEYWORD("while", Token::WHILE) \ |
883 KEYWORD("with", Token::WITH) \ | 883 KEYWORD("with", Token::WITH) \ |
884 KEYWORD_GROUP('y') \ | 884 KEYWORD_GROUP('y') \ |
885 KEYWORD("yield", Token::FUTURE_STRICT_RESERVED_WORD) | 885 KEYWORD("yield", Token::FUTURE_STRICT_RESERVED_WORD) |
886 | 886 |
887 | 887 |
888 static Token::Value KeywordOrIdentifierToken(const char* input, | 888 static Token::Value KeywordOrIdentifierToken(const char* input, |
889 int input_length, | 889 int input_length, |
890 bool harmony_block_scoping) { | 890 bool harmony_block_scoping) { |
891 | |
892 ASSERT(input_length >= 1); | 891 ASSERT(input_length >= 1); |
893 const int kMinLength = 2; | 892 const int kMinLength = 2; |
894 const int kMaxLength = 10; | 893 const int kMaxLength = 10; |
895 if (input_length < kMinLength || input_length > kMaxLength) { | 894 if (input_length < kMinLength || input_length > kMaxLength) { |
896 return Token::IDENTIFIER; | 895 return Token::IDENTIFIER; |
897 } | 896 } |
898 switch (input[0]) { | 897 switch (input[0]) { |
899 default: | 898 default: |
900 #define KEYWORD_GROUP_CASE(ch) \ | 899 #define KEYWORD_GROUP_CASE(ch) \ |
901 break; \ | 900 break; \ |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 } | 1046 } |
1048 AddLiteralCharAdvance(); | 1047 AddLiteralCharAdvance(); |
1049 } | 1048 } |
1050 literal.Complete(); | 1049 literal.Complete(); |
1051 | 1050 |
1052 next_.location.end_pos = source_pos() - 1; | 1051 next_.location.end_pos = source_pos() - 1; |
1053 return true; | 1052 return true; |
1054 } | 1053 } |
1055 | 1054 |
1056 } } // namespace v8::internal | 1055 } } // namespace v8::internal |
OLD | NEW |