| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 3322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3333 | 3333 |
| 3334 | 3334 |
| 3335 TokenPosition Class::ComputeEndTokenPos() const { | 3335 TokenPosition Class::ComputeEndTokenPos() const { |
| 3336 // Return the begin token for synthetic classes. | 3336 // Return the begin token for synthetic classes. |
| 3337 if (is_synthesized_class() || IsMixinApplication() || IsTopLevel()) { | 3337 if (is_synthesized_class() || IsMixinApplication() || IsTopLevel()) { |
| 3338 return token_pos(); | 3338 return token_pos(); |
| 3339 } | 3339 } |
| 3340 const Script& scr = Script::Handle(script()); | 3340 const Script& scr = Script::Handle(script()); |
| 3341 ASSERT(!scr.IsNull()); | 3341 ASSERT(!scr.IsNull()); |
| 3342 const TokenStream& tkns = TokenStream::Handle(scr.tokens()); | 3342 const TokenStream& tkns = TokenStream::Handle(scr.tokens()); |
| 3343 if (tkns.IsNull()) { |
| 3344 ASSERT(Dart::IsRunningPrecompiledCode()); |
| 3345 return TokenPosition::kNoSource; |
| 3346 } |
| 3343 TokenStream::Iterator tkit(tkns, | 3347 TokenStream::Iterator tkit(tkns, |
| 3344 token_pos(), | 3348 token_pos(), |
| 3345 TokenStream::Iterator::kNoNewlines); | 3349 TokenStream::Iterator::kNoNewlines); |
| 3346 intptr_t level = 0; | 3350 intptr_t level = 0; |
| 3347 while (tkit.CurrentTokenKind() != Token::kEOS) { | 3351 while (tkit.CurrentTokenKind() != Token::kEOS) { |
| 3348 if (tkit.CurrentTokenKind() == Token::kLBRACE) { | 3352 if (tkit.CurrentTokenKind() == Token::kLBRACE) { |
| 3349 level++; | 3353 level++; |
| 3350 } else if (tkit.CurrentTokenKind() == Token::kRBRACE) { | 3354 } else if (tkit.CurrentTokenKind() == Token::kRBRACE) { |
| 3351 if (--level == 0) { | 3355 if (--level == 0) { |
| 3352 return tkit.CurrentPosition(); | 3356 return tkit.CurrentPosition(); |
| (...skipping 18425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21778 return UserTag::null(); | 21782 return UserTag::null(); |
| 21779 } | 21783 } |
| 21780 | 21784 |
| 21781 | 21785 |
| 21782 const char* UserTag::ToCString() const { | 21786 const char* UserTag::ToCString() const { |
| 21783 const String& tag_label = String::Handle(label()); | 21787 const String& tag_label = String::Handle(label()); |
| 21784 return tag_label.ToCString(); | 21788 return tag_label.ToCString(); |
| 21785 } | 21789 } |
| 21786 | 21790 |
| 21787 } // namespace dart | 21791 } // namespace dart |
| OLD | NEW |