| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 return Token::WHITESPACE; | 165 return Token::WHITESPACE; |
| 166 } | 166 } |
| 167 | 167 |
| 168 | 168 |
| 169 Token::Value JavaScriptScanner::SkipMultiLineComment() { | 169 Token::Value JavaScriptScanner::SkipMultiLineComment() { |
| 170 ASSERT(c0_ == '*'); | 170 ASSERT(c0_ == '*'); |
| 171 Advance(); | 171 Advance(); |
| 172 | 172 |
| 173 while (c0_ >= 0) { | 173 while (c0_ >= 0) { |
| 174 char ch = c0_; | 174 uc32 ch = c0_; |
| 175 Advance(); | 175 Advance(); |
| 176 if (unicode_cache_->IsLineTerminator(ch)) { | 176 if (unicode_cache_->IsLineTerminator(ch)) { |
| 177 // Following ECMA-262, section 7.4, a comment containing | 177 // Following ECMA-262, section 7.4, a comment containing |
| 178 // a newline will make the comment count as a line-terminator. | 178 // a newline will make the comment count as a line-terminator. |
| 179 has_multiline_comment_before_next_ = true; | 179 has_multiline_comment_before_next_ = true; |
| 180 } | 180 } |
| 181 // If we have reached the end of the multi-line comment, we | 181 // If we have reached the end of the multi-line comment, we |
| 182 // consume the '/' and insert a whitespace. This way all | 182 // consume the '/' and insert a whitespace. This way all |
| 183 // multi-line comments are treated as whitespace. | 183 // multi-line comments are treated as whitespace. |
| 184 if (ch == '*' && c0_ == '/') { | 184 if (ch == '*' && c0_ == '/') { |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 if (MatchKeywordStart(input, "with", 1, Token::WITH)) return; | 957 if (MatchKeywordStart(input, "with", 1, Token::WITH)) return; |
| 958 break; | 958 break; |
| 959 case UNMATCHABLE: | 959 case UNMATCHABLE: |
| 960 break; | 960 break; |
| 961 } | 961 } |
| 962 // On fallthrough, it's a failure. | 962 // On fallthrough, it's a failure. |
| 963 state_ = UNMATCHABLE; | 963 state_ = UNMATCHABLE; |
| 964 } | 964 } |
| 965 | 965 |
| 966 } } // namespace v8::internal | 966 } } // namespace v8::internal |
| OLD | NEW |