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

Side by Side Diff: src/scanner.h

Issue 9490006: Fix illegal escape-sequences to throw syntax errors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/scanner.cc » ('j') | src/scanner.cc » ('J')
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 // 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
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
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();
526 // Decodes a unicode escape-sequence which is part of an identifier. 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 uniocde escape-sequence and adds its characters,
Erik Corry 2012/04/16 14:16:32 uniocde -> Unicode (not just the capitalization)
Michael Starzinger 2012/04/16 15:44:37 Done.
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/scanner.cc » ('j') | src/scanner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698