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

Side by Side Diff: pkg/compiler/lib/src/resolution/send_structure.dart

Issue 1261623002: Add AccessSemantics.INVALID for invalid expressions. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library dart2js.send_structure; 5 library dart2js.send_structure;
6 6
7 import 'access_semantics.dart'; 7 import 'access_semantics.dart';
8 import 'operators.dart'; 8 import 'operators.dart';
9 import 'semantic_visitor.dart'; 9 import 'semantic_visitor.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 node.argumentsNode, 366 node.argumentsNode,
367 selector, 367 selector,
368 arg); 368 arg);
369 case AccessKind.UNRESOLVED_SUPER: 369 case AccessKind.UNRESOLVED_SUPER:
370 return visitor.visitUnresolvedSuperInvoke( 370 return visitor.visitUnresolvedSuperInvoke(
371 node, 371 node,
372 semantics.element, 372 semantics.element,
373 node.argumentsNode, 373 node.argumentsNode,
374 selector, 374 selector,
375 arg); 375 arg);
376 case AccessKind.INVALID:
377 return visitor.errorInvalidInvoke(
378 node,
379 semantics.element,
380 node.argumentsNode,
381 selector,
382 arg);
376 case AccessKind.COMPOUND: 383 case AccessKind.COMPOUND:
377 // This is not a valid case. 384 // This is not a valid case.
378 break; 385 break;
379 } 386 }
380 throw new SpannableAssertionFailure(node, "Invalid invoke: ${semantics}"); 387 throw new SpannableAssertionFailure(node, "Invalid invoke: ${semantics}");
381 } 388 }
382 389
383 String toString() => 'invoke($selector, $semantics)'; 390 String toString() => 'invoke($selector, $semantics)';
384 } 391 }
385 392
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 case AccessKind.UNRESOLVED: 590 case AccessKind.UNRESOLVED:
584 return visitor.visitUnresolvedGet( 591 return visitor.visitUnresolvedGet(
585 node, 592 node,
586 semantics.element, 593 semantics.element,
587 arg); 594 arg);
588 case AccessKind.UNRESOLVED_SUPER: 595 case AccessKind.UNRESOLVED_SUPER:
589 return visitor.visitUnresolvedSuperGet( 596 return visitor.visitUnresolvedSuperGet(
590 node, 597 node,
591 semantics.element, 598 semantics.element,
592 arg); 599 arg);
600 case AccessKind.INVALID:
601 return visitor.errorInvalidGet(
602 node,
603 semantics.element,
604 arg);
593 case AccessKind.COMPOUND: 605 case AccessKind.COMPOUND:
594 // This is not a valid case. 606 // This is not a valid case.
595 break; 607 break;
596 } 608 }
597 throw new SpannableAssertionFailure(node, "Invalid getter: ${semantics}"); 609 throw new SpannableAssertionFailure(node, "Invalid getter: ${semantics}");
598 } 610 }
599 611
600 String toString() => 'get($selector, $semantics)'; 612 String toString() => 'get($selector, $semantics)';
601 } 613 }
602 614
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 // TODO(johnniwinther): Should this be a valid case? 798 // TODO(johnniwinther): Should this be a valid case?
787 break; 799 break;
788 case AccessKind.UNRESOLVED_SUPER: 800 case AccessKind.UNRESOLVED_SUPER:
789 // TODO(johnniwinther): Handle this separately. 801 // TODO(johnniwinther): Handle this separately.
790 case AccessKind.UNRESOLVED: 802 case AccessKind.UNRESOLVED:
791 return visitor.visitUnresolvedSet( 803 return visitor.visitUnresolvedSet(
792 node, 804 node,
793 semantics.element, 805 semantics.element,
794 node.arguments.single, 806 node.arguments.single,
795 arg); 807 arg);
808 case AccessKind.INVALID:
809 return visitor.errorInvalidSet(
810 node,
811 semantics.element,
812 node.arguments.single,
813 arg);
796 case AccessKind.COMPOUND: 814 case AccessKind.COMPOUND:
797 // This is not a valid case. 815 // This is not a valid case.
798 break; 816 break;
799 } 817 }
800 throw new SpannableAssertionFailure(node, "Invalid setter: ${semantics}"); 818 throw new SpannableAssertionFailure(node, "Invalid setter: ${semantics}");
801 } 819 }
802 820
803 String toString() => 'set($selector,$semantics)'; 821 String toString() => 'set($selector,$semantics)';
804 } 822 }
805 823
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 operator, 1479 operator,
1462 node.arguments.single, 1480 node.arguments.single,
1463 arg); 1481 arg);
1464 case AccessKind.UNRESOLVED: 1482 case AccessKind.UNRESOLVED:
1465 return visitor.visitUnresolvedCompound( 1483 return visitor.visitUnresolvedCompound(
1466 node, 1484 node,
1467 semantics.element, 1485 semantics.element,
1468 operator, 1486 operator,
1469 node.arguments.single, 1487 node.arguments.single,
1470 arg); 1488 arg);
1489 case AccessKind.INVALID:
1490 return visitor.errorInvalidCompound(
1491 node,
1492 semantics.element,
1493 operator,
1494 node.arguments.single,
1495 arg);
1471 case AccessKind.COMPOUND: 1496 case AccessKind.COMPOUND:
1472 CompoundAccessSemantics compoundSemantics = semantics; 1497 CompoundAccessSemantics compoundSemantics = semantics;
1473 switch (compoundSemantics.compoundAccessKind) { 1498 switch (compoundSemantics.compoundAccessKind) {
1474 case CompoundAccessKind.STATIC_GETTER_SETTER: 1499 case CompoundAccessKind.STATIC_GETTER_SETTER:
1475 return visitor.visitStaticGetterSetterCompound( 1500 return visitor.visitStaticGetterSetterCompound(
1476 node, 1501 node,
1477 compoundSemantics.getter, 1502 compoundSemantics.getter,
1478 compoundSemantics.setter, 1503 compoundSemantics.setter,
1479 operator, 1504 operator,
1480 node.arguments.single, 1505 node.arguments.single,
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1864 node, 1889 node,
1865 semantics.element, 1890 semantics.element,
1866 operator, 1891 operator,
1867 arg); 1892 arg);
1868 case AccessKind.UNRESOLVED: 1893 case AccessKind.UNRESOLVED:
1869 return visitor.visitUnresolvedPrefix( 1894 return visitor.visitUnresolvedPrefix(
1870 node, 1895 node,
1871 semantics.element, 1896 semantics.element,
1872 operator, 1897 operator,
1873 arg); 1898 arg);
1899 case AccessKind.INVALID:
1900 return visitor.errorInvalidPrefix(
1901 node,
1902 semantics.element,
1903 operator,
1904 arg);
1874 case AccessKind.COMPOUND: 1905 case AccessKind.COMPOUND:
1875 CompoundAccessSemantics compoundSemantics = semantics; 1906 CompoundAccessSemantics compoundSemantics = semantics;
1876 switch (compoundSemantics.compoundAccessKind) { 1907 switch (compoundSemantics.compoundAccessKind) {
1877 case CompoundAccessKind.STATIC_GETTER_SETTER: 1908 case CompoundAccessKind.STATIC_GETTER_SETTER:
1878 return visitor.visitStaticGetterSetterPrefix( 1909 return visitor.visitStaticGetterSetterPrefix(
1879 node, 1910 node,
1880 compoundSemantics.getter, 1911 compoundSemantics.getter,
1881 compoundSemantics.setter, 1912 compoundSemantics.setter,
1882 operator, 1913 operator,
1883 arg); 1914 arg);
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2180 node, 2211 node,
2181 semantics.element, 2212 semantics.element,
2182 operator, 2213 operator,
2183 arg); 2214 arg);
2184 case AccessKind.UNRESOLVED: 2215 case AccessKind.UNRESOLVED:
2185 return visitor.visitUnresolvedPostfix( 2216 return visitor.visitUnresolvedPostfix(
2186 node, 2217 node,
2187 semantics.element, 2218 semantics.element,
2188 operator, 2219 operator,
2189 arg); 2220 arg);
2221 case AccessKind.INVALID:
2222 return visitor.errorInvalidPostfix(
2223 node,
2224 semantics.element,
2225 operator,
2226 arg);
2190 case AccessKind.COMPOUND: 2227 case AccessKind.COMPOUND:
2191 CompoundAccessSemantics compoundSemantics = semantics; 2228 CompoundAccessSemantics compoundSemantics = semantics;
2192 switch (compoundSemantics.compoundAccessKind) { 2229 switch (compoundSemantics.compoundAccessKind) {
2193 case CompoundAccessKind.STATIC_GETTER_SETTER: 2230 case CompoundAccessKind.STATIC_GETTER_SETTER:
2194 return visitor.visitStaticGetterSetterPostfix( 2231 return visitor.visitStaticGetterSetterPostfix(
2195 node, 2232 node,
2196 compoundSemantics.getter, 2233 compoundSemantics.getter,
2197 compoundSemantics.setter, 2234 compoundSemantics.setter,
2198 operator, 2235 operator,
2199 arg); 2236 arg);
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 ThisConstructorInvokeStructure( 2691 ThisConstructorInvokeStructure(
2655 this.node, this.constructor, this.callStructure); 2692 this.node, this.constructor, this.callStructure);
2656 2693
2657 R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg) { 2694 R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg) {
2658 return visitor.visitThisConstructorInvoke( 2695 return visitor.visitThisConstructorInvoke(
2659 node, constructor, node.argumentsNode, callStructure, arg); 2696 node, constructor, node.argumentsNode, callStructure, arg);
2660 } 2697 }
2661 2698
2662 bool get isConstructorInvoke => true; 2699 bool get isConstructorInvoke => true;
2663 } 2700 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart ('k') | pkg/compiler/lib/src/resolved_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698