Commit 9fa50159 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

Revert "[scanner] Add Skip to be used after successful Peek"

This reverts commit 7fb6109b.

Reason for revert: Speculatively reverting because of https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064%20(dbg)/13264

Original change's description:
> [scanner] Add Skip to be used after successful Peek
> 
> Change-Id: Ic3df370e2859bf77572b34a314ad8ed17b75b942
> Reviewed-on: https://chromium-review.googlesource.com/1183485
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55279}

TBR=leszeks@chromium.org,verwaest@chromium.org

Change-Id: Ie1825cb4c971d2ec6a00b7ce3384c97ebbf885ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/1184922Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55301}
parent 4a54b184
......@@ -529,8 +529,7 @@ Token::Value Scanner::ScanHtmlComment() {
PushBack('!'); // undo Advance()
return Token::LT;
}
source_->Skip('-');
DCHECK_EQ('-', c0_);
Advance();
found_html_comment_ = true;
return SkipSingleHTMLComment();
......@@ -675,7 +674,7 @@ void Scanner::Scan() {
if (c0_ == '/') {
uc32 c = Peek();
if (c == '#' || c == '@') {
source_->Skip(c);
Advance();
Advance();
token = SkipSourceURLComment();
} else {
......@@ -728,7 +727,7 @@ void Scanner::Scan() {
token = Token::PERIOD;
if (c0_ == '.') {
if (Peek() == '.') {
source_->Skip('.');
Advance();
Advance();
token = Token::ELLIPSIS;
}
......@@ -1005,8 +1004,8 @@ Token::Value Scanner::ScanTemplateSpan() {
result = Token::TEMPLATE_TAIL;
break;
} else if (c == '$' && Peek() == '{') {
source_->Skip('{');
Advance();
Advance(); // Consume '$'
Advance(); // Consume '{'
break;
} else if (c == '\\') {
Advance(); // Consume '\\'
......
......@@ -50,12 +50,6 @@ class Utf16CharacterStream {
}
}
inline void Skip(uc32 c) {
DCHECK_LT(buffer_cursor_, buffer_end_);
DCHECK_EQ(c, static_cast<uc32>(*buffer_cursor_));
buffer_cursor_++;
}
// Returns and advances past the next UTF-16 code unit in the input
// stream. If there are no more code units it returns kEndOfInput.
inline uc32 Advance() {
......@@ -640,13 +634,13 @@ class Scanner {
bool CombineSurrogatePair() {
DCHECK(!unibrow::Utf16::IsLeadSurrogate(kEndOfInput));
if (unibrow::Utf16::IsLeadSurrogate(c0_)) {
uc32 c1 = source_->Peek();
uc32 c1 = source_->Advance();
DCHECK(!unibrow::Utf16::IsTrailSurrogate(kEndOfInput));
if (unibrow::Utf16::IsTrailSurrogate(c1)) {
c0_ = unibrow::Utf16::CombineSurrogatePair(c0_, c1);
source_->Skip(c1);
return true;
}
source_->Back();
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment