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

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

Issue 2345053003: Behold, a unit test for Scanner::BookmarkScope (& scanner bookmarking). (Closed)
Patch Set: Rebase & fix .gyp file. Created 4 years, 3 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 | « no previous file | src/parsing/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_PARSING_SCANNER_H_ 7 #ifndef V8_PARSING_SCANNER_H_
8 #define V8_PARSING_SCANNER_H_ 8 #define V8_PARSING_SCANNER_H_
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 // [current_] [next_] c0_ | [scanner state] 835 // [current_] [next_] c0_ | [scanner state]
836 // So when the scanner is logically at the beginning of an expression 836 // So when the scanner is logically at the beginning of an expression
837 // like "1234 + 4567", then: 837 // like "1234 + 4567", then:
838 // - current_ contains "1234" 838 // - current_ contains "1234"
839 // - next_ contains "+" 839 // - next_ contains "+"
840 // - c0_ contains ' ' (the space between "+" and "5678", 840 // - c0_ contains ' ' (the space between "+" and "5678",
841 // - the source_ character stream points to the beginning of "5678". 841 // - the source_ character stream points to the beginning of "5678".
842 // To be able to restore this state, we will keep copies of current_, next_, 842 // To be able to restore this state, we will keep copies of current_, next_,
843 // and c0_; we'll ask the stream to bookmark itself, and we'll copy the 843 // and c0_; we'll ask the stream to bookmark itself, and we'll copy the
844 // contents of current_'s and next_'s literal buffers to bookmark_*_literal_. 844 // contents of current_'s and next_'s literal buffers to bookmark_*_literal_.
845 static const uc32 kNoBookmark = -1; 845 static const uc32 kNoBookmark = -2;
846 static const uc32 kBookmarkWasApplied = -2; 846 static const uc32 kBookmarkWasApplied = -3;
847 uc32 bookmark_c0_; 847 uc32 bookmark_c0_;
848 TokenDesc bookmark_current_; 848 TokenDesc bookmark_current_;
849 TokenDesc bookmark_next_; 849 TokenDesc bookmark_next_;
850 LiteralBuffer bookmark_current_literal_; 850 LiteralBuffer bookmark_current_literal_;
851 LiteralBuffer bookmark_current_raw_literal_; 851 LiteralBuffer bookmark_current_raw_literal_;
852 LiteralBuffer bookmark_next_literal_; 852 LiteralBuffer bookmark_next_literal_;
853 LiteralBuffer bookmark_next_raw_literal_; 853 LiteralBuffer bookmark_next_raw_literal_;
854 854
855 // Input stream. Must be initialized to an Utf16CharacterStream. 855 // Input stream. Must be initialized to an Utf16CharacterStream.
856 Utf16CharacterStream* source_; 856 Utf16CharacterStream* source_;
(...skipping 18 matching lines...) Expand all
875 bool found_html_comment_; 875 bool found_html_comment_;
876 876
877 MessageTemplate::Template scanner_error_; 877 MessageTemplate::Template scanner_error_;
878 Location scanner_error_location_; 878 Location scanner_error_location_;
879 }; 879 };
880 880
881 } // namespace internal 881 } // namespace internal
882 } // namespace v8 882 } // namespace v8
883 883
884 #endif // V8_PARSING_SCANNER_H_ 884 #endif // V8_PARSING_SCANNER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698