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

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

Issue 11367069: Make library, import, export, part pseudo-keywords (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « runtime/vm/parser.cc ('k') | runtime/vm/token.h » ('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) 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/scanner.h" 5 #include "vm/scanner.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (!IsLetter(c0_)) { 393 if (!IsLetter(c0_)) {
394 ErrorMsg("Unrecognized library tag"); 394 ErrorMsg("Unrecognized library tag");
395 SkipLine(); 395 SkipLine();
396 return; 396 return;
397 } 397 }
398 const String& kLibrary = String::Handle(Symbols::Library()); 398 const String& kLibrary = String::Handle(Symbols::Library());
399 const String& kImport = String::Handle(Symbols::Import()); 399 const String& kImport = String::Handle(Symbols::Import());
400 const String& kSource = String::Handle(Symbols::Source()); 400 const String& kSource = String::Handle(Symbols::Source());
401 const String& ident = String::Handle(ConsumeIdentChars(false)); 401 const String& ident = String::Handle(ConsumeIdentChars(false));
402 if (ident.Equals(kLibrary)) { 402 if (ident.Equals(kLibrary)) {
403 current_token_.kind = Token::kLIBRARY; 403 current_token_.kind = Token::kLEGACY_LIBRARY;
404 return; 404 return;
405 } 405 }
406 if (ident.Equals(kImport)) { 406 if (ident.Equals(kImport)) {
407 current_token_.kind = Token::kIMPORT; 407 current_token_.kind = Token::kLEGACY_IMPORT;
408 return; 408 return;
409 } 409 }
410 if (ident.Equals(kSource)) { 410 if (ident.Equals(kSource)) {
411 current_token_.kind = Token::kSOURCE; 411 current_token_.kind = Token::kLEGACY_SOURCE;
412 return; 412 return;
413 } 413 }
414 ErrorMsg("Unrecognized library token"); 414 ErrorMsg("Unrecognized library token");
415 SkipLine(); 415 SkipLine();
416 } 416 }
417 417
418 418
419 void Scanner::ScanLiteralString(bool is_raw) { 419 void Scanner::ScanLiteralString(bool is_raw) {
420 ASSERT(!IsScanningString()); 420 ASSERT(!IsScanningString());
421 ASSERT(c0_ == '"' || c0_ == '\''); 421 ASSERT(c0_ == '"' || c0_ == '\'');
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 "%c%#"Px"", kPrivateKeySeparator, key_value); 952 "%c%#"Px"", kPrivateKeySeparator, key_value);
953 const String& result = String::Handle(String::New(private_key, Heap::kOld)); 953 const String& result = String::Handle(String::New(private_key, Heap::kOld));
954 return result.raw(); 954 return result.raw();
955 } 955 }
956 956
957 957
958 void Scanner::InitOnce() { 958 void Scanner::InitOnce() {
959 } 959 }
960 960
961 } // namespace dart 961 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698