| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 // resolved to a keyword. | 770 // resolved to a keyword. |
| 771 if (has_escapes) | 771 if (has_escapes) |
| 772 return Token::IDENTIFIER; | 772 return Token::IDENTIFIER; |
| 773 | 773 |
| 774 return Token::Lookup(&literals_.data()[next_.literal_pos]); | 774 return Token::Lookup(&literals_.data()[next_.literal_pos]); |
| 775 } | 775 } |
| 776 | 776 |
| 777 | 777 |
| 778 | 778 |
| 779 bool Scanner::IsIdentifier(unibrow::CharacterStream* buffer) { | 779 bool Scanner::IsIdentifier(unibrow::CharacterStream* buffer) { |
| 780 // Checks whether the buffer contains an identifier (no escapse). | 780 // Checks whether the buffer contains an identifier (no escape). |
| 781 if (!buffer->has_more()) return false; | 781 if (!buffer->has_more()) return false; |
| 782 if (!kIsIdentifierStart.get(buffer->GetNext())) return false; | 782 if (!kIsIdentifierStart.get(buffer->GetNext())) return false; |
| 783 while (buffer->has_more()) { | 783 while (buffer->has_more()) { |
| 784 if (!kIsIdentifierPart.get(buffer->GetNext())) return false; | 784 if (!kIsIdentifierPart.get(buffer->GetNext())) return false; |
| 785 } | 785 } |
| 786 return true; | 786 return true; |
| 787 } | 787 } |
| 788 | 788 |
| 789 | 789 |
| 790 bool Scanner::ScanRegExpPattern(bool seen_equal) { | 790 bool Scanner::ScanRegExpPattern(bool seen_equal) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 StartLiteral(); | 831 StartLiteral(); |
| 832 while (kIsIdentifierPart.get(c0_)) | 832 while (kIsIdentifierPart.get(c0_)) |
| 833 AddCharAdvance(); | 833 AddCharAdvance(); |
| 834 TerminateLiteral(); | 834 TerminateLiteral(); |
| 835 | 835 |
| 836 next_.location.end_pos = source_pos() - 1; | 836 next_.location.end_pos = source_pos() - 1; |
| 837 return true; | 837 return true; |
| 838 } | 838 } |
| 839 | 839 |
| 840 } } // namespace v8::internal | 840 } } // namespace v8::internal |
| OLD | NEW |