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

Side by Side Diff: dart/frog/leg/resolver.dart

Issue 9395043: Only warn that const expressions are not implemented. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | dart/tests/co19/co19-leg.status » ('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 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 } 8 }
9 9
10 class TreeElementMapping implements TreeElements { 10 class TreeElementMapping implements TreeElements {
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 visitWhile(While node) { 845 visitWhile(While node) {
846 visit(node.condition); 846 visit(node.condition);
847 visitLoopBodyIn(node, node.body, new BlockScope(context)); 847 visitLoopBodyIn(node, node.body, new BlockScope(context));
848 } 848 }
849 849
850 visitParenthesizedExpression(ParenthesizedExpression node) { 850 visitParenthesizedExpression(ParenthesizedExpression node) {
851 visit(node.expression); 851 visit(node.expression);
852 } 852 }
853 853
854 visitNewExpression(NewExpression node) { 854 visitNewExpression(NewExpression node) {
855 if (node.isConst()) cancel(node, 'const expressions are not implemented'); 855 if (node.isConst()) {
856 warning(node, MessageKind.GENERIC,
857 ['const expressions are not implemented']);
858 }
856 Node selector = node.send.selector; 859 Node selector = node.send.selector;
857 if (selector.asTypeAnnotation() === null) { 860 if (selector.asTypeAnnotation() === null) {
858 cancel( 861 cancel(
859 node, 'named constructors with type arguments are not implemented'); 862 node, 'named constructors with type arguments are not implemented');
860 } 863 }
861 864
862 FunctionElement constructor = resolveConstructor(node); 865 FunctionElement constructor = resolveConstructor(node);
863 handleArguments(node.send); 866 handleArguments(node.send);
864 if (constructor === null) return null; 867 if (constructor === null) return null;
865 // TODO(karlklose): handle optional arguments. 868 // TODO(karlklose): handle optional arguments.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 typeRequired = old; 911 typeRequired = old;
909 return cls; 912 return cls;
910 } 913 }
911 914
912 visitModifiers(Modifiers node) { 915 visitModifiers(Modifiers node) {
913 // TODO(ngeoffray): Implement this. 916 // TODO(ngeoffray): Implement this.
914 unimplemented(node, 'modifiers'); 917 unimplemented(node, 'modifiers');
915 } 918 }
916 919
917 visitLiteralList(LiteralList node) { 920 visitLiteralList(LiteralList node) {
918 if (node.isConst()) cancel(node, 'const literal lists are not implemented'); 921 if (node.isConst()) {
922 warning(node, MessageKind.GENERIC,
923 ['const literal lists are not implemented']);
924 }
919 visit(node.elements); 925 visit(node.elements);
920 } 926 }
921 927
922 visitConditional(Conditional node) { 928 visitConditional(Conditional node) {
923 node.visitChildren(this); 929 node.visitChildren(this);
924 } 930 }
925 931
926 visitStringInterpolation(StringInterpolation node) { 932 visitStringInterpolation(StringInterpolation node) {
927 node.visitChildren(this); 933 node.visitChildren(this);
928 } 934 }
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 class TopScope extends Scope { 1355 class TopScope extends Scope {
1350 LibraryElement get library() => element; 1356 LibraryElement get library() => element;
1351 1357
1352 TopScope(LibraryElement library) : super(null, library); 1358 TopScope(LibraryElement library) : super(null, library);
1353 Element lookup(SourceString name) => library.find(name); 1359 Element lookup(SourceString name) => library.find(name);
1354 1360
1355 Element add(Element element) { 1361 Element add(Element element) {
1356 throw "Cannot add an element in the top scope"; 1362 throw "Cannot add an element in the top scope";
1357 } 1363 }
1358 } 1364 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698