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

Side by Side Diff: pkg/analyzer2dart/lib/src/cps_generator.dart

Issue 669673006: Add SExpression test and share tests between dart2dart and analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 2 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 | pkg/analyzer2dart/lib/src/semantic_visitor.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer2dart.cps_generator; 5 library analyzer2dart.cps_generator;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 8
9 import 'package:compiler/implementation/elements/elements.dart' as dart2js; 9 import 'package:compiler/implementation/elements/elements.dart' as dart2js;
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (value == null) { 62 if (value == null) {
63 giveUp(argument, 63 giveUp(argument,
64 'Unsupported argument: $argument (${argument.runtimeType}).'); 64 'Unsupported argument: $argument (${argument.runtimeType}).');
65 } 65 }
66 arguments.add(value); 66 arguments.add(value);
67 } 67 }
68 return arguments; 68 return arguments;
69 } 69 }
70 70
71 @override 71 @override
72 ir.Node visitMethodInvocation(MethodInvocation node) {
73 // Overridden to avoid eager visits of the receiver and arguments.
74 return handleMethodInvocation(node);
75 }
76
77 @override
72 ir.Primitive visitDynamicInvocation(MethodInvocation node, 78 ir.Primitive visitDynamicInvocation(MethodInvocation node,
73 AccessSemantics semantics) { 79 AccessSemantics semantics) {
74 // TODO(johnniwinther): Handle implicit `this`. 80 // TODO(johnniwinther): Handle implicit `this`.
75 ir.Primitive receiver = build(semantics.target); 81 ir.Primitive receiver = build(semantics.target);
76 List<ir.Definition> arguments = visitArguments(node.argumentList); 82 List<ir.Definition> arguments = visitArguments(node.argumentList);
77 return irBuilder.buildDynamicInvocation( 83 return irBuilder.buildDynamicInvocation(
78 receiver, 84 receiver,
79 createSelectorFromMethodInvocation(node, node.methodName.name), 85 createSelectorFromMethodInvocation(node, node.methodName.name),
80 arguments); 86 arguments);
81 } 87 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 visitStringInterpolation(StringInterpolation node) { 136 visitStringInterpolation(StringInterpolation node) {
131 giveUp(node, "String interpolation."); 137 giveUp(node, "String interpolation.");
132 } 138 }
133 139
134 @override 140 @override
135 visitReturnStatement(ReturnStatement node) { 141 visitReturnStatement(ReturnStatement node) {
136 irBuilder.buildReturn(build(node.expression)); 142 irBuilder.buildReturn(build(node.expression));
137 } 143 }
138 144
139 @override 145 @override
146 ir.Node visitPropertyAccess(PropertyAccess node) {
147 // Overridden to avoid eager visits of the receiver.
148 return handlePropertyAccess(node);
149 }
150
151 @override
140 ir.Node visitLocalVariableAccess(AstNode node, AccessSemantics semantics) { 152 ir.Node visitLocalVariableAccess(AstNode node, AccessSemantics semantics) {
141 return handleLocalAccess(node, semantics); 153 return handleLocalAccess(node, semantics);
142 } 154 }
143 155
144 @override 156 @override
145 ir.Node visitParameterAccess(AstNode node, AccessSemantics semantics) { 157 ir.Node visitParameterAccess(AstNode node, AccessSemantics semantics) {
146 return handleLocalAccess(node, semantics); 158 return handleLocalAccess(node, semantics);
147 } 159 }
148 160
149 @override 161 @override
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 236 }
225 237
226 @override 238 @override
227 visitIfStatement(IfStatement node) { 239 visitIfStatement(IfStatement node) {
228 irBuilder.buildIf( 240 irBuilder.buildIf(
229 build(node.condition), 241 build(node.condition),
230 subbuild(node.thenStatement), 242 subbuild(node.thenStatement),
231 subbuild(node.elseStatement)); 243 subbuild(node.elseStatement));
232 } 244 }
233 } 245 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer2dart/lib/src/semantic_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698