Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: runtime/vm/parser.cc

Issue 102443008: Detect missing with clause in mixing applications (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/mixin_illegal_syntax_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 3892 matching lines...) Expand 10 before | Expand all | Expand 10 after
3903 "class '%s' may not extend 'dynamic'", 3903 "class '%s' may not extend 'dynamic'",
3904 class_name.ToCString()); 3904 class_name.ToCString());
3905 } 3905 }
3906 if (super_type.IsTypeParameter()) { 3906 if (super_type.IsTypeParameter()) {
3907 ErrorMsg(type_pos, 3907 ErrorMsg(type_pos,
3908 "class '%s' may not extend type parameter '%s'", 3908 "class '%s' may not extend type parameter '%s'",
3909 class_name.ToCString(), 3909 class_name.ToCString(),
3910 String::Handle(super_type.UserVisibleName()).ToCString()); 3910 String::Handle(super_type.UserVisibleName()).ToCString());
3911 } 3911 }
3912 // The class finalizer will check whether the super type is malbounded. 3912 // The class finalizer will check whether the super type is malbounded.
3913 if (is_mixin_declaration) {
3914 if (CurrentToken() != Token::kWITH) {
3915 ErrorMsg("mixin application clause 'with type' expected");
3916 }
3917 cls.set_is_mixin_app_alias();
3918 cls.set_is_synthesized_class();
3919 }
3913 if (CurrentToken() == Token::kWITH) { 3920 if (CurrentToken() == Token::kWITH) {
3914 super_type = ParseMixins(super_type); 3921 super_type = ParseMixins(super_type);
3915 } 3922 }
3916 if (is_mixin_declaration) {
3917 cls.set_is_mixin_app_alias();
3918 cls.set_is_synthesized_class();
3919 }
3920 } else { 3923 } else {
3921 // No extends clause: implicitly extend Object, unless Object itself. 3924 // No extends clause: implicitly extend Object, unless Object itself.
3922 if (!cls.IsObjectClass()) { 3925 if (!cls.IsObjectClass()) {
3923 super_type = Type::ObjectType(); 3926 super_type = Type::ObjectType();
3924 } 3927 }
3925 } 3928 }
3926 ASSERT(!super_type.IsNull() || cls.IsObjectClass()); 3929 ASSERT(!super_type.IsNull() || cls.IsObjectClass());
3927 cls.set_super_type(super_type); 3930 cls.set_super_type(super_type);
3928 3931
3929 if (CurrentToken() == Token::kIMPLEMENTS) { 3932 if (CurrentToken() == Token::kIMPLEMENTS) {
(...skipping 6823 matching lines...) Expand 10 before | Expand all | Expand 10 after
10753 void Parser::SkipQualIdent() { 10756 void Parser::SkipQualIdent() {
10754 ASSERT(IsIdentifier()); 10757 ASSERT(IsIdentifier());
10755 ConsumeToken(); 10758 ConsumeToken();
10756 if (CurrentToken() == Token::kPERIOD) { 10759 if (CurrentToken() == Token::kPERIOD) {
10757 ConsumeToken(); // Consume the kPERIOD token. 10760 ConsumeToken(); // Consume the kPERIOD token.
10758 ExpectIdentifier("identifier expected after '.'"); 10761 ExpectIdentifier("identifier expected after '.'");
10759 } 10762 }
10760 } 10763 }
10761 10764
10762 } // namespace dart 10765 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/mixin_illegal_syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698