OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 Token::Value SkipSingleLineComment(); | 513 Token::Value SkipSingleLineComment(); |
514 Token::Value SkipMultiLineComment(); | 514 Token::Value SkipMultiLineComment(); |
515 // Scans a possible HTML comment -- begins with '<!'. | 515 // Scans a possible HTML comment -- begins with '<!'. |
516 Token::Value ScanHtmlComment(); | 516 Token::Value ScanHtmlComment(); |
517 | 517 |
518 void ScanDecimalDigits(); | 518 void ScanDecimalDigits(); |
519 Token::Value ScanNumber(bool seen_period); | 519 Token::Value ScanNumber(bool seen_period); |
520 Token::Value ScanIdentifierOrKeyword(); | 520 Token::Value ScanIdentifierOrKeyword(); |
521 Token::Value ScanIdentifierSuffix(LiteralScope* literal); | 521 Token::Value ScanIdentifierSuffix(LiteralScope* literal); |
522 | 522 |
523 void ScanEscape(); | |
524 Token::Value ScanString(); | 523 Token::Value ScanString(); |
525 | 524 |
526 // Decodes a unicode escape-sequence which is part of an identifier. | 525 // Scans an escape-sequence which is part of a string and adds the |
| 526 // decoded character to the current literal. Returns true if a pattern |
| 527 // is scanned. |
| 528 bool ScanEscape(); |
| 529 // Decodes a Unicode escape-sequence which is part of an identifier. |
527 // If the escape sequence cannot be decoded the result is kBadChar. | 530 // If the escape sequence cannot be decoded the result is kBadChar. |
528 uc32 ScanIdentifierUnicodeEscape(); | 531 uc32 ScanIdentifierUnicodeEscape(); |
529 // Recognizes a uniocde escape-sequence and adds its characters, | 532 // Scans a Unicode escape-sequence and adds its characters, |
530 // uninterpreted, to the current literal. Used for parsing RegExp | 533 // uninterpreted, to the current literal. Used for parsing RegExp |
531 // flags. | 534 // flags. |
532 bool ScanLiteralUnicodeEscape(); | 535 bool ScanLiteralUnicodeEscape(); |
533 | 536 |
534 // Return the current source position. | 537 // Return the current source position. |
535 int source_pos() { | 538 int source_pos() { |
536 return source_->pos() - kCharacterLookaheadBufferSize; | 539 return source_->pos() - kCharacterLookaheadBufferSize; |
537 } | 540 } |
538 | 541 |
539 UnicodeCache* unicode_cache_; | 542 UnicodeCache* unicode_cache_; |
(...skipping 24 matching lines...) Expand all Loading... |
564 bool has_multiline_comment_before_next_; | 567 bool has_multiline_comment_before_next_; |
565 // Whether we scan 'let' as a keyword for harmony block-scoped let bindings. | 568 // Whether we scan 'let' as a keyword for harmony block-scoped let bindings. |
566 bool harmony_scoping_; | 569 bool harmony_scoping_; |
567 // Whether we scan 'module', 'import', 'export' as keywords. | 570 // Whether we scan 'module', 'import', 'export' as keywords. |
568 bool harmony_modules_; | 571 bool harmony_modules_; |
569 }; | 572 }; |
570 | 573 |
571 } } // namespace v8::internal | 574 } } // namespace v8::internal |
572 | 575 |
573 #endif // V8_SCANNER_H_ | 576 #endif // V8_SCANNER_H_ |
OLD | NEW |