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

Side by Side Diff: src/scanner.h

Issue 1262913003: [es6] Remove Scanner and Parser flags for harmony_modules (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add flag-setting to cctests Created 5 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
« no previous file with comments | « src/preparser.h ('k') | src/scanner.cc » ('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 // 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 471
472 // Returns the value of the last smi that was scanned. 472 // Returns the value of the last smi that was scanned.
473 int smi_value() const { return current_.smi_value_; } 473 int smi_value() const { return current_.smi_value_; }
474 474
475 // Seek forward to the given position. This operation does not 475 // Seek forward to the given position. This operation does not
476 // work in general, for instance when there are pushed back 476 // work in general, for instance when there are pushed back
477 // characters, but works for seeking forward until simple delimiter 477 // characters, but works for seeking forward until simple delimiter
478 // tokens, which is what it is used for. 478 // tokens, which is what it is used for.
479 void SeekForward(int pos); 479 void SeekForward(int pos);
480 480
481 bool HarmonyModules() const {
482 return harmony_modules_;
483 }
484 void SetHarmonyModules(bool modules) {
485 harmony_modules_ = modules;
486 }
487
488 bool HarmonyUnicode() const { return harmony_unicode_; } 481 bool HarmonyUnicode() const { return harmony_unicode_; }
489 void SetHarmonyUnicode(bool unicode) { harmony_unicode_ = unicode; } 482 void SetHarmonyUnicode(bool unicode) { harmony_unicode_ = unicode; }
490 483
491 // Returns true if there was a line terminator before the peek'ed token, 484 // Returns true if there was a line terminator before the peek'ed token,
492 // possibly inside a multi-line comment. 485 // possibly inside a multi-line comment.
493 bool HasAnyLineTerminatorBeforeNext() const { 486 bool HasAnyLineTerminatorBeforeNext() const {
494 return has_line_terminator_before_next_ || 487 return has_line_terminator_before_next_ ||
495 has_multiline_comment_before_next_; 488 has_multiline_comment_before_next_;
496 } 489 }
497 490
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 // One Unicode character look-ahead; c0_ < 0 at the end of the input. 783 // One Unicode character look-ahead; c0_ < 0 at the end of the input.
791 uc32 c0_; 784 uc32 c0_;
792 785
793 // Whether there is a line terminator whitespace character after 786 // Whether there is a line terminator whitespace character after
794 // the current token, and before the next. Does not count newlines 787 // the current token, and before the next. Does not count newlines
795 // inside multiline comments. 788 // inside multiline comments.
796 bool has_line_terminator_before_next_; 789 bool has_line_terminator_before_next_;
797 // Whether there is a multi-line comment that contains a 790 // Whether there is a multi-line comment that contains a
798 // line-terminator after the current token, and before the next. 791 // line-terminator after the current token, and before the next.
799 bool has_multiline_comment_before_next_; 792 bool has_multiline_comment_before_next_;
800 // Whether we scan 'module', 'import', 'export' as keywords.
801 bool harmony_modules_;
802 // Whether we allow \u{xxxxx}. 793 // Whether we allow \u{xxxxx}.
803 bool harmony_unicode_; 794 bool harmony_unicode_;
804 }; 795 };
805 796
806 } } // namespace v8::internal 797 } } // namespace v8::internal
807 798
808 #endif // V8_SCANNER_H_ 799 #endif // V8_SCANNER_H_
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | src/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698