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

Side by Side Diff: lib/src/codegen/assignments_index.dart

Issue 1710583002: Fix tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Fix hints and reformat Created 4 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
« no previous file with comments | « lib/runtime/dart/js.js ('k') | lib/src/codegen/ast_builder.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) 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 import 'package:analyzer/dart/ast/token.dart';
5 import 'package:analyzer/src/generated/ast.dart'; 6 import 'package:analyzer/src/generated/ast.dart';
6 import 'package:analyzer/src/generated/element.dart'; 7 import 'package:analyzer/src/generated/element.dart';
7 import 'package:analyzer/src/generated/scanner.dart';
8 8
9 import 'ast_builder.dart'; 9 import 'ast_builder.dart';
10 10
11 /// Creates an index of variable assignments and declarations occurring in all 11 /// Creates an index of variable assignments and declarations occurring in all
12 /// the provided [nodes]. 12 /// the provided [nodes].
13 /// 13 ///
14 /// Expands any compound assignment expression (e.g. `i += 2` yields an assigned 14 /// Expands any compound assignment expression (e.g. `i += 2` yields an assigned
15 /// expression of `i + 2`), and treats declarations with no assignment as having 15 /// expression of `i + 2`), and treats declarations with no assignment as having
16 /// a `null` assigned expression. 16 /// a `null` assigned expression.
17 Map<LocalVariableElement, List<Expression>> indexLocalAssignments( 17 Map<LocalVariableElement, List<Expression>> indexLocalAssignments(
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 Token _opToken(TokenType t) => new Token(t, 0); 137 Token _opToken(TokenType t) => new Token(t, 0);
138 138
139 /// Transforms `+=` to `+`, `??=` to `??`, etc. 139 /// Transforms `+=` to `+`, `??=` to `??`, etc.
140 TokenType _expandAssignmentOp(TokenType assignmentOp) { 140 TokenType _expandAssignmentOp(TokenType assignmentOp) {
141 assert(assignmentOp.isAssignmentOperator); 141 assert(assignmentOp.isAssignmentOperator);
142 var op = _opByAssignmentOp[assignmentOp]; 142 var op = _opByAssignmentOp[assignmentOp];
143 if (op == null) throw new ArgumentError("Can't expand op $assignmentOp"); 143 if (op == null) throw new ArgumentError("Can't expand op $assignmentOp");
144 return op; 144 return op;
145 } 145 }
OLDNEW
« no previous file with comments | « lib/runtime/dart/js.js ('k') | lib/src/codegen/ast_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698