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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 KEYWORD("true", Token::TRUE_LITERAL) \ | 870 KEYWORD("true", Token::TRUE_LITERAL) \ |
871 KEYWORD("try", Token::TRY) \ | 871 KEYWORD("try", Token::TRY) \ |
872 KEYWORD("typeof", Token::TYPEOF) \ | 872 KEYWORD("typeof", Token::TYPEOF) \ |
873 KEYWORD_GROUP('v') \ | 873 KEYWORD_GROUP('v') \ |
874 KEYWORD("var", Token::VAR) \ | 874 KEYWORD("var", Token::VAR) \ |
875 KEYWORD("void", Token::VOID) \ | 875 KEYWORD("void", Token::VOID) \ |
876 KEYWORD_GROUP('w') \ | 876 KEYWORD_GROUP('w') \ |
877 KEYWORD("while", Token::WHILE) \ | 877 KEYWORD("while", Token::WHILE) \ |
878 KEYWORD("with", Token::WITH) \ | 878 KEYWORD("with", Token::WITH) \ |
879 KEYWORD_GROUP('y') \ | 879 KEYWORD_GROUP('y') \ |
880 KEYWORD("yield", Token::FUTURE_STRICT_RESERVED_WORD) | 880 KEYWORD("yield", Token::YIELD) |
881 | 881 |
882 | 882 |
883 static Token::Value KeywordOrIdentifierToken(const char* input, | 883 static Token::Value KeywordOrIdentifierToken(const char* input, |
884 int input_length, | 884 int input_length, |
885 bool harmony_scoping, | 885 bool harmony_scoping, |
886 bool harmony_modules) { | 886 bool harmony_modules) { |
887 ASSERT(input_length >= 1); | 887 ASSERT(input_length >= 1); |
888 const int kMinLength = 2; | 888 const int kMinLength = 2; |
889 const int kMaxLength = 10; | 889 const int kMaxLength = 10; |
890 if (input_length < kMinLength || input_length > kMaxLength) { | 890 if (input_length < kMinLength || input_length > kMaxLength) { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 Advance(); | 1080 Advance(); |
1081 } | 1081 } |
1082 } | 1082 } |
1083 literal.Complete(); | 1083 literal.Complete(); |
1084 | 1084 |
1085 next_.location.end_pos = source_pos() - 1; | 1085 next_.location.end_pos = source_pos() - 1; |
1086 return true; | 1086 return true; |
1087 } | 1087 } |
1088 | 1088 |
1089 } } // namespace v8::internal | 1089 } } // namespace v8::internal |
OLD | NEW |