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

Side by Side Diff: src/parsing/scanner.cc

Issue 2751693002: [wasm][asm.js] Adding custom asm.js lexer. (Closed)
Patch Set: fix Created 3 years, 9 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Features shared by parsing and pre-parsing scanners. 5 // Features shared by parsing and pre-parsing scanners.
6 6
7 #include "src/parsing/scanner.h" 7 #include "src/parsing/scanner.h"
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 return ScanTemplateSpan(); 1158 return ScanTemplateSpan();
1159 } 1159 }
1160 1160
1161 1161
1162 Token::Value Scanner::ScanTemplateContinuation() { 1162 Token::Value Scanner::ScanTemplateContinuation() {
1163 DCHECK_EQ(next_.token, Token::RBRACE); 1163 DCHECK_EQ(next_.token, Token::RBRACE);
1164 next_.location.beg_pos = source_pos() - 1; // We already consumed } 1164 next_.location.beg_pos = source_pos() - 1; // We already consumed }
1165 return ScanTemplateSpan(); 1165 return ScanTemplateSpan();
1166 } 1166 }
1167 1167
1168 Handle<String> Scanner::SourceUrl(Isolate* isolate) const {
1169 Handle<String> tmp;
1170 if (source_url_.length() > 0) tmp = source_url_.Internalize(isolate);
1171 return tmp;
1172 }
1173
1174 Handle<String> Scanner::SourceMappingUrl(Isolate* isolate) const {
1175 Handle<String> tmp;
1176 if (source_mapping_url_.length() > 0)
1177 tmp = source_mapping_url_.Internalize(isolate);
1178 return tmp;
1179 }
1168 1180
1169 void Scanner::ScanDecimalDigits() { 1181 void Scanner::ScanDecimalDigits() {
1170 while (IsDecimalDigit(c0_)) 1182 while (IsDecimalDigit(c0_))
1171 AddLiteralCharAdvance(); 1183 AddLiteralCharAdvance();
1172 } 1184 }
1173 1185
1174 1186
1175 Token::Value Scanner::ScanNumber(bool seen_period) { 1187 Token::Value Scanner::ScanNumber(bool seen_period) {
1176 DCHECK(IsDecimalDigit(c0_)); // the first digit of the number or the fraction 1188 DCHECK(IsDecimalDigit(c0_)); // the first digit of the number or the fraction
1177 1189
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 // 2, reset the source to the desired position, 1756 // 2, reset the source to the desired position,
1745 source_->Seek(position); 1757 source_->Seek(position);
1746 // 3, re-scan, by scanning the look-ahead char + 1 token (next_). 1758 // 3, re-scan, by scanning the look-ahead char + 1 token (next_).
1747 c0_ = source_->Advance(); 1759 c0_ = source_->Advance();
1748 Next(); 1760 Next();
1749 DCHECK_EQ(next_.location.beg_pos, static_cast<int>(position)); 1761 DCHECK_EQ(next_.location.beg_pos, static_cast<int>(position));
1750 } 1762 }
1751 1763
1752 } // namespace internal 1764 } // namespace internal
1753 } // namespace v8 1765 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698