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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 if (!IsLetter(c0_)) { | 390 if (!IsLetter(c0_)) { |
391 ErrorMsg("Unrecognized library tag"); | 391 ErrorMsg("Unrecognized library tag"); |
392 SkipLine(); | 392 SkipLine(); |
393 return; | 393 return; |
394 } | 394 } |
395 const String& kLibrary = String::Handle(Symbols::Library()); | 395 const String& kLibrary = String::Handle(Symbols::Library()); |
396 const String& kImport = String::Handle(Symbols::Import()); | 396 const String& kImport = String::Handle(Symbols::Import()); |
397 const String& kSource = String::Handle(Symbols::Source()); | 397 const String& kSource = String::Handle(Symbols::Source()); |
398 const String& ident = String::Handle(ConsumeIdentChars(false)); | 398 const String& ident = String::Handle(ConsumeIdentChars(false)); |
399 if (ident.Equals(kLibrary)) { | 399 if (ident.Equals(kLibrary)) { |
400 current_token_.kind = Token::kLIBRARY; | 400 current_token_.kind = Token::kLEGACY_LIBRARY; |
401 return; | 401 return; |
402 } | 402 } |
403 if (ident.Equals(kImport)) { | 403 if (ident.Equals(kImport)) { |
404 current_token_.kind = Token::kIMPORT; | 404 current_token_.kind = Token::kLEGACY_IMPORT; |
405 return; | 405 return; |
406 } | 406 } |
407 if (ident.Equals(kSource)) { | 407 if (ident.Equals(kSource)) { |
408 current_token_.kind = Token::kSOURCE; | 408 current_token_.kind = Token::kLEGACY_SOURCE; |
409 return; | 409 return; |
410 } | 410 } |
411 ErrorMsg("Unrecognized library token"); | 411 ErrorMsg("Unrecognized library token"); |
412 SkipLine(); | 412 SkipLine(); |
413 } | 413 } |
414 | 414 |
415 | 415 |
416 void Scanner::ScanLiteralString(bool is_raw) { | 416 void Scanner::ScanLiteralString(bool is_raw) { |
417 ASSERT(!IsScanningString()); | 417 ASSERT(!IsScanningString()); |
418 ASSERT(c0_ == '"' || c0_ == '\''); | 418 ASSERT(c0_ == '"' || c0_ == '\''); |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 "%c%#"Px"", kPrivateKeySeparator, key_value); | 949 "%c%#"Px"", kPrivateKeySeparator, key_value); |
950 const String& result = String::Handle(String::New(private_key, Heap::kOld)); | 950 const String& result = String::Handle(String::New(private_key, Heap::kOld)); |
951 return result.raw(); | 951 return result.raw(); |
952 } | 952 } |
953 | 953 |
954 | 954 |
955 void Scanner::InitOnce() { | 955 void Scanner::InitOnce() { |
956 } | 956 } |
957 | 957 |
958 } // namespace dart | 958 } // namespace dart |
OLD | NEW |