Changeset 66962 in webkit for trunk/JavaScriptCore/parser/Lexer.cpp
- Timestamp:
- Sep 8, 2010, 2:59:24 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/parser/Lexer.cpp
r66375 r66962 676 676 } 677 677 678 ALWAYS_INLINE bool Lexer::parseMultilineComment() 679 { 680 while (true) { 681 while (UNLIKELY(m_current == '*')) { 682 shift(); 683 if (m_current == '/') { 684 shift(); 685 return true; 686 } 687 } 688 689 if (UNLIKELY(m_current == -1)) 690 return false; 691 692 if (isLineTerminator(m_current)) 693 shiftLineTerminator(); 694 else 695 shift(); 696 } 697 } 698 678 699 JSTokenType Lexer::lex(JSTokenData* lvalp, JSTokenInfo* llocp, LexType lexType) 679 700 { … … 836 857 if (m_current == '*') { 837 858 shift(); 838 goto inMultiLineComment; 859 if (parseMultilineComment()) 860 goto start; 861 goto returnError; 839 862 } 840 863 if (m_current == '=') { … … 1029 1052 goto start; 1030 1053 1031 inMultiLineComment:1032 while (true) {1033 if (UNLIKELY(m_current == '*')) {1034 shift();1035 if (m_current == '/')1036 break;1037 if (m_current == '*')1038 continue;1039 }1040 1041 if (UNLIKELY(m_current == -1))1042 goto returnError;1043 1044 if (isLineTerminator(m_current))1045 shiftLineTerminator();1046 else1047 shift();1048 }1049 shift();1050 goto start;1051 1052 1054 doneSemicolon: 1053 1055 token = SEMICOLON;
Note:
See TracChangeset
for help on using the changeset viewer.