| 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 } | 385 } |
| 386 if (current_token_.kind != Token::kILLEGAL) { | 386 if (current_token_.kind != Token::kILLEGAL) { |
| 387 intptr_t len = lookahead_pos_ - token_start_; | 387 intptr_t len = lookahead_pos_ - token_start_; |
| 388 current_token_.literal = | 388 current_token_.literal = |
| 389 &String::ZoneHandle( | 389 &String::ZoneHandle( |
| 390 String::SubString(source_, token_start_, len, Heap::kOld)); | 390 String::SubString(source_, token_start_, len, Heap::kOld)); |
| 391 } | 391 } |
| 392 } | 392 } |
| 393 | 393 |
| 394 | 394 |
| 395 RawString* Scanner::ConsumeIdentChars(bool allow_dollar) { | |
| 396 ASSERT(IsIdentStartChar(c0_)); | |
| 397 ASSERT(allow_dollar || (c0_ != '$')); | |
| 398 int ident_length = 0; | |
| 399 int32_t ident_pos = lookahead_pos_; | |
| 400 while (IsIdentChar(c0_) && (allow_dollar || (c0_ != '$'))) { | |
| 401 ReadChar(); | |
| 402 ident_length++; | |
| 403 } | |
| 404 return Symbols::New(source_, ident_pos, ident_length); | |
| 405 } | |
| 406 | |
| 407 | |
| 408 void Scanner::SkipLine() { | 395 void Scanner::SkipLine() { |
| 409 while (c0_ != '\n' && c0_ != '\0') { | 396 while (c0_ != '\n' && c0_ != '\0') { |
| 410 ReadChar(); | 397 ReadChar(); |
| 411 } | 398 } |
| 412 } | 399 } |
| 413 | 400 |
| 414 | 401 |
| 415 void Scanner::ScanScriptTag() { | 402 void Scanner::ScanScriptTag() { |
| 416 ReadChar(); | 403 ReadChar(); |
| 417 if (c0_ == '!') { | 404 if (c0_ == '!') { |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 "%c%#"Px"", kPrivateKeySeparator, key_value); | 941 "%c%#"Px"", kPrivateKeySeparator, key_value); |
| 955 const String& result = String::Handle(String::New(private_key, Heap::kOld)); | 942 const String& result = String::Handle(String::New(private_key, Heap::kOld)); |
| 956 return result.raw(); | 943 return result.raw(); |
| 957 } | 944 } |
| 958 | 945 |
| 959 | 946 |
| 960 void Scanner::InitOnce() { | 947 void Scanner::InitOnce() { |
| 961 } | 948 } |
| 962 | 949 |
| 963 } // namespace dart | 950 } // namespace dart |
| OLD | NEW |