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

Side by Side Diff: runtime/vm/parser.cc

Issue 1131493007: Compute accurate token count when loading from snapshot (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 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 | « runtime/vm/object.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/ast_transformer.h" 9 #include "vm/ast_transformer.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 return current_class_; 436 return current_class_;
437 } 437 }
438 438
439 439
440 void Parser::set_current_class(const Class& value) { 440 void Parser::set_current_class(const Class& value) {
441 current_class_ = value.raw(); 441 current_class_ = value.raw();
442 } 442 }
443 443
444 444
445 void Parser::SetPosition(intptr_t position) { 445 void Parser::SetPosition(intptr_t position) {
446 if (position < TokenPos() && position != 0) {
447 INC_STAT(I, num_tokens_rewind, (TokenPos() - position));
448 }
449 tokens_iterator_.SetCurrentPosition(position); 446 tokens_iterator_.SetCurrentPosition(position);
450 token_kind_ = Token::kILLEGAL; 447 token_kind_ = Token::kILLEGAL;
451 } 448 }
452 449
453 450
454 void Parser::ParseCompilationUnit(const Library& library, 451 void Parser::ParseCompilationUnit(const Library& library,
455 const Script& script) { 452 const Script& script) {
456 Isolate* isolate = Isolate::Current(); 453 Isolate* isolate = Isolate::Current();
457 ASSERT(isolate->long_jump_base()->IsSafeToJump()); 454 ASSERT(isolate->long_jump_base()->IsSafeToJump());
458 CSTAT_TIMER_SCOPE(isolate, parser_timer); 455 CSTAT_TIMER_SCOPE(isolate, parser_timer);
(...skipping 13019 matching lines...) Expand 10 before | Expand all | Expand 10 after
13478 void Parser::SkipQualIdent() { 13475 void Parser::SkipQualIdent() {
13479 ASSERT(IsIdentifier()); 13476 ASSERT(IsIdentifier());
13480 ConsumeToken(); 13477 ConsumeToken();
13481 if (CurrentToken() == Token::kPERIOD) { 13478 if (CurrentToken() == Token::kPERIOD) {
13482 ConsumeToken(); // Consume the kPERIOD token. 13479 ConsumeToken(); // Consume the kPERIOD token.
13483 ExpectIdentifier("identifier expected after '.'"); 13480 ExpectIdentifier("identifier expected after '.'");
13484 } 13481 }
13485 } 13482 }
13486 13483
13487 } // namespace dart 13484 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698