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

Side by Side Diff: src/scanner.h

Issue 1066933005: Use ExpressionClassifier for bindings. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasre + feedback = patch for landing Created 5 years, 7 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
« no previous file with comments | « src/preparser.cc ('k') | no next file » | 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 // 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 #ifndef V8_SCANNER_H_ 7 #ifndef V8_SCANNER_H_
8 #define V8_SCANNER_H_ 8 #define V8_SCANNER_H_
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 Location() : beg_pos(0), end_pos(0) { } 348 Location() : beg_pos(0), end_pos(0) { }
349 349
350 bool IsValid() const { 350 bool IsValid() const {
351 return beg_pos >= 0 && end_pos >= beg_pos; 351 return beg_pos >= 0 && end_pos >= beg_pos;
352 } 352 }
353 353
354 static Location invalid() { return Location(-1, -1); } 354 static Location invalid() { return Location(-1, -1); }
355 355
356 int beg_pos; 356 int beg_pos;
357 int end_pos; 357 int end_pos;
358
359 bool inline operator==(const Location& other) const {
360 return beg_pos == other.beg_pos && end_pos == other.end_pos;
361 }
362
363 bool inline operator!=(const Location& other) const {
364 return !(*this == other);
365 }
366 }; 358 };
367 359
368 // -1 is outside of the range of any real source code. 360 // -1 is outside of the range of any real source code.
369 static const int kNoOctalLocation = -1; 361 static const int kNoOctalLocation = -1;
370 362
371 explicit Scanner(UnicodeCache* scanner_contants); 363 explicit Scanner(UnicodeCache* scanner_contants);
372 364
373 void Initialize(Utf16CharacterStream* source); 365 void Initialize(Utf16CharacterStream* source);
374 366
375 // Returns the next token and advances input. 367 // Returns the next token and advances input.
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 bool harmony_modules_; 735 bool harmony_modules_;
744 // Whether we scan 'class', 'extends', 'static' and 'super' as keywords. 736 // Whether we scan 'class', 'extends', 'static' and 'super' as keywords.
745 bool harmony_classes_; 737 bool harmony_classes_;
746 // Whether we allow \u{xxxxx}. 738 // Whether we allow \u{xxxxx}.
747 bool harmony_unicode_; 739 bool harmony_unicode_;
748 }; 740 };
749 741
750 } } // namespace v8::internal 742 } } // namespace v8::internal
751 743
752 #endif // V8_SCANNER_H_ 744 #endif // V8_SCANNER_H_
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698