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 "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 new LiteralNode(ident_pos, Object::transition_sentinel())); | 949 new LiteralNode(ident_pos, Object::transition_sentinel())); |
950 // Set field to null prior to throwing exception, so that subsequent | 950 // Set field to null prior to throwing exception, so that subsequent |
951 // accesses to the field do not throw again, since initializers should only | 951 // accesses to the field do not throw again, since initializers should only |
952 // be executed once. | 952 // be executed once. |
953 SequenceNode* report_circular = new SequenceNode(ident_pos, NULL); | 953 SequenceNode* report_circular = new SequenceNode(ident_pos, NULL); |
954 report_circular->Add( | 954 report_circular->Add( |
955 new StoreStaticFieldNode( | 955 new StoreStaticFieldNode( |
956 ident_pos, | 956 ident_pos, |
957 field, | 957 field, |
958 new LiteralNode(ident_pos, Instance::ZoneHandle()))); | 958 new LiteralNode(ident_pos, Instance::ZoneHandle()))); |
959 // TODO(regis): Exception to throw is not specified by spec. | 959 // TODO(regis, 5802): Exception to throw is not specified by spec. |
960 const String& circular_error = String::ZoneHandle( | 960 const String& circular_error = String::ZoneHandle( |
961 Symbols::New("circular dependency in field initialization")); | 961 Symbols::New("circular dependency in field initialization")); |
962 report_circular->Add( | 962 report_circular->Add( |
963 new ThrowNode(ident_pos, | 963 new ThrowNode(ident_pos, |
964 new LiteralNode(ident_pos, circular_error), | 964 new LiteralNode(ident_pos, circular_error), |
965 NULL)); | 965 NULL)); |
966 AstNode* circular_check = | 966 AstNode* circular_check = |
967 new IfNode(ident_pos, compare_circular, report_circular, NULL); | 967 new IfNode(ident_pos, compare_circular, report_circular, NULL); |
968 current_block_->statements->Add(circular_check); | 968 current_block_->statements->Add(circular_check); |
969 | 969 |
(...skipping 8997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9967 void Parser::SkipQualIdent() { | 9967 void Parser::SkipQualIdent() { |
9968 ASSERT(IsIdentifier()); | 9968 ASSERT(IsIdentifier()); |
9969 ConsumeToken(); | 9969 ConsumeToken(); |
9970 if (CurrentToken() == Token::kPERIOD) { | 9970 if (CurrentToken() == Token::kPERIOD) { |
9971 ConsumeToken(); // Consume the kPERIOD token. | 9971 ConsumeToken(); // Consume the kPERIOD token. |
9972 ExpectIdentifier("identifier expected after '.'"); | 9972 ExpectIdentifier("identifier expected after '.'"); |
9973 } | 9973 } |
9974 } | 9974 } |
9975 | 9975 |
9976 } // namespace dart | 9976 } // namespace dart |
OLD | NEW |