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

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

Issue 693153002: Support is/as expressions in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/tree_shaker.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/dart_types.dart' as dart2js; 9 import 'package:compiler/implementation/dart_types.dart' as dart2js;
10 import 'package:compiler/implementation/elements/elements.dart' as dart2js; 10 import 'package:compiler/implementation/elements/elements.dart' as dart2js;
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 buildBody: subbuild(node.body), 336 buildBody: subbuild(node.body),
337 buildUpdate: subbuildSequence(node.updaters)); 337 buildUpdate: subbuildSequence(node.updaters));
338 } 338 }
339 339
340 @override 340 @override
341 visitWhileStatement(WhileStatement node) { 341 visitWhileStatement(WhileStatement node) {
342 // TODO(johnniwinther): Support `while` as a jump target. 342 // TODO(johnniwinther): Support `while` as a jump target.
343 irBuilder.buildWhile(buildCondition: subbuild(node.condition), 343 irBuilder.buildWhile(buildCondition: subbuild(node.condition),
344 buildBody: subbuild(node.body)); 344 buildBody: subbuild(node.body));
345 } 345 }
346
347 @override
348 ir.Primitive visitIsExpression(IsExpression node) {
349 return irBuilder.buildTypeOperator(
350 visit(node.expression),
351 converter.convertType(node.type.type),
352 isTypeTest: true,
353 isNotCheck: node.notOperator != null);
354 }
355
356 @override
357 ir.Primitive visitAsExpression(AsExpression node) {
358 return irBuilder.buildTypeOperator(
359 visit(node.expression),
360 converter.convertType(node.type.type),
361 isTypeTest: false);
362 }
346 } 363 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer2dart/lib/src/tree_shaker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698