OLD | NEW |
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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 // The script tag extends to the end of the line. Just treat this | 419 // The script tag extends to the end of the line. Just treat this |
420 // similar to a line comment. | 420 // similar to a line comment. |
421 SkipLine(); | 421 SkipLine(); |
422 return; | 422 return; |
423 } | 423 } |
424 if (!IsLetter(c0_)) { | 424 if (!IsLetter(c0_)) { |
425 ErrorMsg("Unrecognized library tag"); | 425 ErrorMsg("Unrecognized library tag"); |
426 SkipLine(); | 426 SkipLine(); |
427 return; | 427 return; |
428 } | 428 } |
429 const String& kLibrary = String::Handle(Symbols::Library()); | |
430 const String& kImport = String::Handle(Symbols::Import()); | |
431 const String& kSource = String::Handle(Symbols::Source()); | |
432 const String& ident = String::Handle(ConsumeIdentChars(false)); | 429 const String& ident = String::Handle(ConsumeIdentChars(false)); |
433 if (ident.Equals(kLibrary)) { | 430 if (ident.Equals(Symbols::Library())) { |
434 current_token_.kind = Token::kLEGACY_LIBRARY; | 431 current_token_.kind = Token::kLEGACY_LIBRARY; |
435 return; | 432 return; |
436 } | 433 } |
437 if (ident.Equals(kImport)) { | 434 if (ident.Equals(Symbols::Import())) { |
438 current_token_.kind = Token::kLEGACY_IMPORT; | 435 current_token_.kind = Token::kLEGACY_IMPORT; |
439 return; | 436 return; |
440 } | 437 } |
441 if (ident.Equals(kSource)) { | 438 if (ident.Equals(Symbols::Source())) { |
442 current_token_.kind = Token::kLEGACY_SOURCE; | 439 current_token_.kind = Token::kLEGACY_SOURCE; |
443 return; | 440 return; |
444 } | 441 } |
445 ErrorMsg("Unrecognized library token"); | 442 ErrorMsg("Unrecognized library token"); |
446 SkipLine(); | 443 SkipLine(); |
447 } | 444 } |
448 | 445 |
449 | 446 |
450 void Scanner::ScanLiteralString(bool is_raw) { | 447 void Scanner::ScanLiteralString(bool is_raw) { |
451 ASSERT(!IsScanningString()); | 448 ASSERT(!IsScanningString()); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 "%c%#"Px"", kPrivateKeySeparator, key_value); | 983 "%c%#"Px"", kPrivateKeySeparator, key_value); |
987 const String& result = String::Handle(String::New(private_key, Heap::kOld)); | 984 const String& result = String::Handle(String::New(private_key, Heap::kOld)); |
988 return result.raw(); | 985 return result.raw(); |
989 } | 986 } |
990 | 987 |
991 | 988 |
992 void Scanner::InitOnce() { | 989 void Scanner::InitOnce() { |
993 } | 990 } |
994 | 991 |
995 } // namespace dart | 992 } // namespace dart |
OLD | NEW |