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

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

Issue 10752017: Rename Script's source to Source. Trace parser (--trace-parser) only if source is available (thus s… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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_test.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 "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 static const char* kPhaseParameterName = ":phase"; 54 static const char* kPhaseParameterName = ":phase";
55 static const char* kGetIteratorName = "iterator"; 55 static const char* kGetIteratorName = "iterator";
56 static const char* kNoSuchMethodName = "noSuchMethod"; 56 static const char* kNoSuchMethodName = "noSuchMethod";
57 57
58 #if defined(DEBUG) 58 #if defined(DEBUG)
59 59
60 class TraceParser : public ValueObject { 60 class TraceParser : public ValueObject {
61 public: 61 public:
62 TraceParser(intptr_t token_pos, const Script& script, const char* msg) { 62 TraceParser(intptr_t token_pos, const Script& script, const char* msg) {
63 if (FLAG_trace_parser) { 63 if (FLAG_trace_parser) {
64 intptr_t line, column; 64 // Skips tracing of bootstrap libraries.
65 script.GetTokenLocation(token_pos, &line, &column); 65 if (script.HasSource()) {
66 PrintIndent(); 66 intptr_t line, column;
67 OS::Print("%s (line %d, col %d, token %d)\n", 67 script.GetTokenLocation(token_pos, &line, &column);
68 msg, line, column, token_pos); 68 PrintIndent();
69 OS::Print("%s (line %d, col %d, token %d)\n",
70 msg, line, column, token_pos);
71 }
69 indent_++; 72 indent_++;
70 } 73 }
71 } 74 }
72 ~TraceParser() { indent_--; } 75 ~TraceParser() { indent_--; }
73 private: 76 private:
74 void PrintIndent() { 77 void PrintIndent() {
75 for (int i = 0; i < indent_; i++) { OS::Print(". "); } 78 for (int i = 0; i < indent_; i++) { OS::Print(". "); }
76 } 79 }
77 static int indent_; 80 static int indent_;
78 }; 81 };
(...skipping 8571 matching lines...) Expand 10 before | Expand all | Expand 10 after
8650 void Parser::SkipQualIdent() { 8653 void Parser::SkipQualIdent() {
8651 ASSERT(IsIdentifier()); 8654 ASSERT(IsIdentifier());
8652 ConsumeToken(); 8655 ConsumeToken();
8653 if (CurrentToken() == Token::kPERIOD) { 8656 if (CurrentToken() == Token::kPERIOD) {
8654 ConsumeToken(); // Consume the kPERIOD token. 8657 ConsumeToken(); // Consume the kPERIOD token.
8655 ExpectIdentifier("identifier expected after '.'"); 8658 ExpectIdentifier("identifier expected after '.'");
8656 } 8659 }
8657 } 8660 }
8658 8661
8659 } // namespace dart 8662 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698