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

Side by Side Diff: lib/kernel_visitor.dart

Issue 2087503002: Getting enums for free. (Closed) Base URL: git@github.com:dart-lang/rasta.git@prune_unsupported
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | test/kernel/regression/enum.dart » ('j') | test/kernel/regression/enum.dart.txt » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library rasta.kernel_visitor; 5 library rasta.kernel_visitor;
6 6
7 import 'package:kernel/ast.dart' as ir; 7 import 'package:kernel/ast.dart' as ir;
8 8
9 import 'package:kernel/accessors.dart' show 9 import 'package:kernel/accessors.dart' show
10 Accessor, 10 Accessor,
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 return buildBreakTarget( 759 return buildBreakTarget(
760 new ir.DoStatement(body, condition), node, jumpTarget); 760 new ir.DoStatement(body, condition), node, jumpTarget);
761 } 761 }
762 762
763 @override 763 @override
764 ir.EmptyStatement visitEmptyStatement(EmptyStatement node) { 764 ir.EmptyStatement visitEmptyStatement(EmptyStatement node) {
765 return new ir.EmptyStatement(); 765 return new ir.EmptyStatement();
766 } 766 }
767 767
768 @override 768 @override
769 ir.Throw visitEnum(Enum node) { 769 visitEnum(Enum node) {
770 return buildUnsupported(node, "Enum"); 770 // Not called normally. In dart2js, enums are represented as class
771 // elements, so `classToIr` handles enums. All the synthetic members of an
772 // enum class have already been installed by dart2js and we don't have to
773 // do anything special.
774 return internalError(node, "Enum");
771 } 775 }
772 776
773 @override 777 @override
774 ir.ExpressionStatement visitExpressionStatement(ExpressionStatement node) { 778 ir.ExpressionStatement visitExpressionStatement(ExpressionStatement node) {
775 return new ir.ExpressionStatement(visitForEffect(node.expression)); 779 return new ir.ExpressionStatement(visitForEffect(node.expression));
776 } 780 }
777 781
778 @override 782 @override
779 ir.Statement visitFor(For node) { 783 ir.Statement visitFor(For node) {
780 VariableDefinitions initializers = 784 VariableDefinitions initializers =
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
3049 : this(null, true, node, initializers); 3053 : this(null, true, node, initializers);
3050 3054
3051 accept(ir.Visitor v) => throw "unsupported"; 3055 accept(ir.Visitor v) => throw "unsupported";
3052 3056
3053 visitChildren(ir.Visitor v) => throw "unsupported"; 3057 visitChildren(ir.Visitor v) => throw "unsupported";
3054 3058
3055 String toString() { 3059 String toString() {
3056 return "IrFunction($kind, $isConstructor, $node, $initializers)"; 3060 return "IrFunction($kind, $isConstructor, $node, $initializers)";
3057 } 3061 }
3058 } 3062 }
OLDNEW
« no previous file with comments | « no previous file | test/kernel/regression/enum.dart » ('j') | test/kernel/regression/enum.dart.txt » ('J')

Powered by Google App Engine
This is Rietveld 408576698