Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: src/scanner-base.cc

Issue 7585004: Fix bug in scanner. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1546.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1546.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698