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

Side by Side Diff: src/scanner-base.cc

Issue 5593004: Changed interface to preparser to not require pushback support. (Closed)
Patch Set: Created 10 years 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
« src/preparser-api.cc ('K') | « src/preparser-api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 ASSERT(pos >= current_pos); 505 ASSERT(pos >= current_pos);
506 if (pos != current_pos) { 506 if (pos != current_pos) {
507 source_->SeekForward(pos - source_->pos()); 507 source_->SeekForward(pos - source_->pos());
508 Advance(); 508 Advance();
509 // This function is only called to seek to the location 509 // This function is only called to seek to the location
510 // of the end of a function (at the "}" token). It doesn't matter 510 // of the end of a function (at the "}" token). It doesn't matter
511 // whether there was a line terminator in the part we skip. 511 // whether there was a line terminator in the part we skip.
512 has_line_terminator_before_next_ = false; 512 has_line_terminator_before_next_ = false;
513 } 513 }
514 Scan(); 514 Scan();
515 ASSERT_EQ(Token::RBRACE, next_.token);
Lasse Reichstein 2010/12/08 09:28:58 This only holds in real use. The unit-tests are mo
516 } 515 }
517 516
518 517
519 void JavaScriptScanner::ScanEscape() { 518 void JavaScriptScanner::ScanEscape() {
520 uc32 c = c0_; 519 uc32 c = c0_;
521 Advance(); 520 Advance();
522 521
523 // Skip escaped newlines. 522 // Skip escaped newlines.
524 if (ScannerConstants::kIsLineTerminator.get(c)) { 523 if (ScannerConstants::kIsLineTerminator.get(c)) {
525 // Allow CR+LF newlines in multiline string literals. 524 // Allow CR+LF newlines in multiline string literals.
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 if (MatchKeywordStart(input, "with", 1, Token::WITH)) return; 916 if (MatchKeywordStart(input, "with", 1, Token::WITH)) return;
918 break; 917 break;
919 case UNMATCHABLE: 918 case UNMATCHABLE:
920 break; 919 break;
921 } 920 }
922 // On fallthrough, it's a failure. 921 // On fallthrough, it's a failure.
923 state_ = UNMATCHABLE; 922 state_ = UNMATCHABLE;
924 } 923 }
925 924
926 } } // namespace v8::internal 925 } } // namespace v8::internal
OLDNEW
« src/preparser-api.cc ('K') | « src/preparser-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698