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

Unified Diff: src/scanner.cc

Issue 700963002: Replace C++ bitfields with our own BitFields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index 8062faa2447403af9354c1304200401521ebb123..8fd1077bbf29125b6b569519bc65ea363ed89080 100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -245,6 +245,8 @@ bool Scanner::SkipWhiteSpace() {
while (true) {
while (true) {
+ // The unicode cache accepts unsigned inputs.
+ if (c0_ < 0) break;
Sven Panne 2014/11/05 09:11:49 How is this related to the bitfield fiddling?
Jakob Kummerow 2014/11/05 12:13:46 As the comment says, the unicode_cache_ only accep
// Advance as long as character is a WhiteSpace or LineTerminator.
// Remember if the latter is the case.
if (unicode_cache_->IsLineTerminator(c0_)) {
@@ -625,14 +627,14 @@ void Scanner::Scan() {
break;
default:
- if (unicode_cache_->IsIdentifierStart(c0_)) {
+ if (c0_ < 0) {
+ token = Token::EOS;
Sven Panne 2014/11/05 09:11:49 Same here...
+ } else if (unicode_cache_->IsIdentifierStart(c0_)) {
token = ScanIdentifierOrKeyword();
} else if (IsDecimalDigit(c0_)) {
token = ScanNumber(false);
} else if (SkipWhiteSpace()) {
token = Token::WHITESPACE;
- } else if (c0_ < 0) {
- token = Token::EOS;
} else {
token = Select(Token::ILLEGAL);
}

Powered by Google App Engine
This is Rietveld 408576698