| OLD | NEW |
| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 static Location invalid() { return Location(-1, -1); } | 334 static Location invalid() { return Location(-1, -1); } |
| 335 | 335 |
| 336 int beg_pos; | 336 int beg_pos; |
| 337 int end_pos; | 337 int end_pos; |
| 338 }; | 338 }; |
| 339 | 339 |
| 340 // -1 is outside of the range of any real source code. | 340 // -1 is outside of the range of any real source code. |
| 341 static const int kNoOctalLocation = -1; | 341 static const int kNoOctalLocation = -1; |
| 342 | 342 |
| 343 Scanner(UnicodeCache* scanner_contants, bool allow_html_comments); | 343 explicit Scanner(UnicodeCache* scanner_contants); |
| 344 | 344 |
| 345 void Initialize(Utf16CharacterStream* source); | 345 void Initialize(Utf16CharacterStream* source); |
| 346 | 346 |
| 347 // Returns the next token and advances input. | 347 // Returns the next token and advances input. |
| 348 Token::Value Next(); | 348 Token::Value Next(); |
| 349 // Returns the token following peek() | 349 // Returns the token following peek() |
| 350 Token::Value PeekAhead(); | 350 Token::Value PeekAhead(); |
| 351 // Returns the current token again. | 351 // Returns the current token again. |
| 352 Token::Value current_token() { return current_.token; } | 352 Token::Value current_token() { return current_.token; } |
| 353 // Returns the location information for the current token | 353 // Returns the location information for the current token |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 // One Unicode character look-ahead; c0_ < 0 at the end of the input. | 754 // One Unicode character look-ahead; c0_ < 0 at the end of the input. |
| 755 uc32 c0_; | 755 uc32 c0_; |
| 756 | 756 |
| 757 // Whether there is a line terminator whitespace character after | 757 // Whether there is a line terminator whitespace character after |
| 758 // the current token, and before the next. Does not count newlines | 758 // the current token, and before the next. Does not count newlines |
| 759 // inside multiline comments. | 759 // inside multiline comments. |
| 760 bool has_line_terminator_before_next_; | 760 bool has_line_terminator_before_next_; |
| 761 // Whether there is a multi-line comment that contains a | 761 // Whether there is a multi-line comment that contains a |
| 762 // line-terminator after the current token, and before the next. | 762 // line-terminator after the current token, and before the next. |
| 763 bool has_multiline_comment_before_next_; | 763 bool has_multiline_comment_before_next_; |
| 764 // Whether to allow HTML comments (that is, skip over them, rather than | |
| 765 // reporting the comment marker as a sequence of tokens.) | |
| 766 bool allow_html_comments_; | |
| 767 | 764 |
| 768 // Whether this scanner encountered an HTML comment. | 765 // Whether this scanner encountered an HTML comment. |
| 769 bool found_html_comment_; | 766 bool found_html_comment_; |
| 770 | 767 |
| 771 bool allow_harmony_exponentiation_operator_; | 768 bool allow_harmony_exponentiation_operator_; |
| 772 }; | 769 }; |
| 773 | 770 |
| 774 } // namespace internal | 771 } // namespace internal |
| 775 } // namespace v8 | 772 } // namespace v8 |
| 776 | 773 |
| 777 #endif // V8_PARSING_SCANNER_H_ | 774 #endif // V8_PARSING_SCANNER_H_ |
| OLD | NEW |