| 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/parser.h" | 5 #include "vm/parser.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/ast_transformer.h" | 9 #include "vm/ast_transformer.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "vm/symbols.h" | 33 #include "vm/symbols.h" |
| 34 #include "vm/tags.h" | 34 #include "vm/tags.h" |
| 35 #include "vm/timer.h" | 35 #include "vm/timer.h" |
| 36 #include "vm/zone.h" | 36 #include "vm/zone.h" |
| 37 | 37 |
| 38 namespace dart { | 38 namespace dart { |
| 39 | 39 |
| 40 DEFINE_FLAG(bool, enable_asserts, false, "Enable assert statements."); | 40 DEFINE_FLAG(bool, enable_asserts, false, "Enable assert statements."); |
| 41 DEFINE_FLAG(bool, enable_debug_break, false, "Allow use of break \"message\"."); | 41 DEFINE_FLAG(bool, enable_debug_break, false, "Allow use of break \"message\"."); |
| 42 DEFINE_FLAG(bool, enable_type_checks, false, "Enable type checks."); | 42 DEFINE_FLAG(bool, enable_type_checks, false, "Enable type checks."); |
| 43 DEFINE_FLAG(bool, load_deferred_eagerly, false, |
| 44 "Load deferred libraries eagerly."); |
| 43 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); | 45 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); |
| 44 DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef."); | 46 DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef."); |
| 45 DECLARE_FLAG(bool, error_on_bad_type); | 47 DECLARE_FLAG(bool, error_on_bad_type); |
| 46 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 48 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 47 DECLARE_FLAG(bool, warn_on_javascript_compatibility); | 49 DECLARE_FLAG(bool, warn_on_javascript_compatibility); |
| 48 | 50 |
| 49 static void CheckedModeHandler(bool value) { | 51 static void CheckedModeHandler(bool value) { |
| 50 FLAG_enable_asserts = value; | 52 FLAG_enable_asserts = value; |
| 51 FLAG_enable_type_checks = value; | 53 FLAG_enable_type_checks = value; |
| 52 } | 54 } |
| (...skipping 5719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5772 // Create a new library if it does not exist yet. | 5774 // Create a new library if it does not exist yet. |
| 5773 Library& library = Library::Handle(Z, Library::LookupLibrary(canon_url)); | 5775 Library& library = Library::Handle(Z, Library::LookupLibrary(canon_url)); |
| 5774 if (library.IsNull()) { | 5776 if (library.IsNull()) { |
| 5775 library = Library::New(canon_url); | 5777 library = Library::New(canon_url); |
| 5776 library.Register(); | 5778 library.Register(); |
| 5777 } | 5779 } |
| 5778 | 5780 |
| 5779 // If loading hasn't been requested yet, and if this is not a deferred | 5781 // If loading hasn't been requested yet, and if this is not a deferred |
| 5780 // library import, call the library tag handler to request loading | 5782 // library import, call the library tag handler to request loading |
| 5781 // the library. | 5783 // the library. |
| 5782 if (library.LoadNotStarted() && !is_deferred_import) { | 5784 if (library.LoadNotStarted() && |
| 5785 (!is_deferred_import || FLAG_load_deferred_eagerly)) { |
| 5783 library.SetLoadRequested(); | 5786 library.SetLoadRequested(); |
| 5784 CallLibraryTagHandler(Dart_kImportTag, import_pos, canon_url); | 5787 CallLibraryTagHandler(Dart_kImportTag, import_pos, canon_url); |
| 5785 } | 5788 } |
| 5786 | 5789 |
| 5787 Namespace& ns = Namespace::Handle(Z, | 5790 Namespace& ns = Namespace::Handle(Z, |
| 5788 Namespace::New(library, show_names, hide_names)); | 5791 Namespace::New(library, show_names, hide_names)); |
| 5789 if (metadata_pos >= 0) { | 5792 if (metadata_pos >= 0) { |
| 5790 ns.AddMetadata(metadata_pos, current_class()); | 5793 ns.AddMetadata(metadata_pos, current_class()); |
| 5791 } | 5794 } |
| 5792 | 5795 |
| (...skipping 7684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13477 void Parser::SkipQualIdent() { | 13480 void Parser::SkipQualIdent() { |
| 13478 ASSERT(IsIdentifier()); | 13481 ASSERT(IsIdentifier()); |
| 13479 ConsumeToken(); | 13482 ConsumeToken(); |
| 13480 if (CurrentToken() == Token::kPERIOD) { | 13483 if (CurrentToken() == Token::kPERIOD) { |
| 13481 ConsumeToken(); // Consume the kPERIOD token. | 13484 ConsumeToken(); // Consume the kPERIOD token. |
| 13482 ExpectIdentifier("identifier expected after '.'"); | 13485 ExpectIdentifier("identifier expected after '.'"); |
| 13483 } | 13486 } |
| 13484 } | 13487 } |
| 13485 | 13488 |
| 13486 } // namespace dart | 13489 } // namespace dart |
| OLD | NEW |