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

Side by Side Diff: runtime/vm/scanner.h

Issue 8586052: Better error handling when scanning library tags (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month 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 | runtime/vm/scanner.cc » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Scanner class for the Dart language. The scanner reads source text 5 // Scanner class for the Dart language. The scanner reads source text
6 // and produces a stream of tokens which is used by the parser. 6 // and produces a stream of tokens which is used by the parser.
7 // 7 //
8 8
9 #ifndef VM_SCANNER_H_ 9 #ifndef VM_SCANNER_H_
10 #define VM_SCANNER_H_ 10 #define VM_SCANNER_H_
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 int keyword_len; 93 int keyword_len;
94 String* keyword_symbol; 94 String* keyword_symbol;
95 }; 95 };
96 96
97 // Initialize Scanner tables. 97 // Initialize Scanner tables.
98 void InitKeywordTable(); 98 void InitKeywordTable();
99 99
100 // Reads next lookahead character. 100 // Reads next lookahead character.
101 void ReadChar(); 101 void ReadChar();
102 102
103 // Read and discard characters up to end of line.
104 void SkipLine();
105
103 // Recognizes token 'kind' and reads next character in input. 106 // Recognizes token 'kind' and reads next character in input.
104 void Recognize(Token::Kind kind) { 107 void Recognize(Token::Kind kind) {
105 ReadChar(); 108 ReadChar();
106 current_token_.kind = kind; 109 current_token_.kind = kind;
107 } 110 }
108 111
109 int32_t LookaheadChar(int how_many); 112 int32_t LookaheadChar(int how_many);
110 113
111 void ErrorMsg(const char* msg); 114 void ErrorMsg(const char* msg);
112 115
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 const String& private_key_; 194 const String& private_key_;
192 195
193 SourcePosition c0_pos_; // Source position of lookahead character c0_. 196 SourcePosition c0_pos_; // Source position of lookahead character c0_.
194 KeywordTable keywords_[Token::numKeywords]; 197 KeywordTable keywords_[Token::numKeywords];
195 }; 198 };
196 199
197 200
198 } // namespace dart 201 } // namespace dart
199 202
200 #endif // VM_SCANNER_H_ 203 #endif // VM_SCANNER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698