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

Side by Side Diff: pkg/kernel/lib/clone.dart

Issue 3008463002: Store the covariant keyword flag for parameters and fields into Kernel and resynthesize in analyzer. (Closed)
Patch Set: Update Field in binary. Created 3 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
« no previous file with comments | « pkg/kernel/lib/ast.dart ('k') | pkg/kernel/lib/text/ast_to_text.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) 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 library kernel.clone; 4 library kernel.clone;
5 5
6 import 'ast.dart'; 6 import 'ast.dart';
7 import 'type_algebra.dart'; 7 import 'type_algebra.dart';
8 8
9 /// Visitor that return a clone of a tree, maintaining references to cloned 9 /// Visitor that return a clone of a tree, maintaining references to cloned
10 /// objects. 10 /// objects.
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 353 }
354 354
355 visitYieldStatement(YieldStatement node) { 355 visitYieldStatement(YieldStatement node) {
356 return new YieldStatement(clone(node.expression)); 356 return new YieldStatement(clone(node.expression));
357 } 357 }
358 358
359 visitVariableDeclaration(VariableDeclaration node) { 359 visitVariableDeclaration(VariableDeclaration node) {
360 return variables[node] = new VariableDeclaration(node.name, 360 return variables[node] = new VariableDeclaration(node.name,
361 initializer: cloneOptional(node.initializer), 361 initializer: cloneOptional(node.initializer),
362 type: visitType(node.type), 362 type: visitType(node.type),
363 isCovariant: node.isCovariant,
363 isFinal: node.isFinal, 364 isFinal: node.isFinal,
364 isConst: node.isConst, 365 isConst: node.isConst,
365 isFieldFormal: node.isFieldFormal); 366 isFieldFormal: node.isFieldFormal);
366 } 367 }
367 368
368 visitFunctionDeclaration(FunctionDeclaration node) { 369 visitFunctionDeclaration(FunctionDeclaration node) {
369 var newVariable = clone(node.variable); 370 var newVariable = clone(node.variable);
370 return new FunctionDeclaration(newVariable, clone(node.function)); 371 return new FunctionDeclaration(newVariable, clone(node.function));
371 } 372 }
372 373
(...skipping 16 matching lines...) Expand all
389 isConst: node.isConst, 390 isConst: node.isConst,
390 transformerFlags: node.transformerFlags, 391 transformerFlags: node.transformerFlags,
391 fileUri: node.fileUri) 392 fileUri: node.fileUri)
392 ..fileEndOffset = node.fileEndOffset; 393 ..fileEndOffset = node.fileEndOffset;
393 } 394 }
394 395
395 visitField(Field node) { 396 visitField(Field node) {
396 return new Field(node.name, 397 return new Field(node.name,
397 type: visitType(node.type), 398 type: visitType(node.type),
398 initializer: cloneOptional(node.initializer), 399 initializer: cloneOptional(node.initializer),
400 isCovariant: node.isCovariant,
399 isFinal: node.isFinal, 401 isFinal: node.isFinal,
400 isConst: node.isConst, 402 isConst: node.isConst,
401 isStatic: node.isStatic, 403 isStatic: node.isStatic,
402 hasImplicitGetter: node.hasImplicitGetter, 404 hasImplicitGetter: node.hasImplicitGetter,
403 hasImplicitSetter: node.hasImplicitSetter, 405 hasImplicitSetter: node.hasImplicitSetter,
404 transformerFlags: node.transformerFlags, 406 transformerFlags: node.transformerFlags,
405 fileUri: node.fileUri) 407 fileUri: node.fileUri)
406 ..fileEndOffset = node.fileEndOffset; 408 ..fileEndOffset = node.fileEndOffset;
407 } 409 }
408 410
(...skipping 24 matching lines...) Expand all
433 visitArguments(Arguments node) { 435 visitArguments(Arguments node) {
434 return new Arguments(node.positional.map(clone).toList(), 436 return new Arguments(node.positional.map(clone).toList(),
435 types: node.types.map(visitType).toList(), 437 types: node.types.map(visitType).toList(),
436 named: node.named.map(clone).toList()); 438 named: node.named.map(clone).toList());
437 } 439 }
438 440
439 visitNamedExpression(NamedExpression node) { 441 visitNamedExpression(NamedExpression node) {
440 return new NamedExpression(node.name, clone(node.value)); 442 return new NamedExpression(node.name, clone(node.value));
441 } 443 }
442 } 444 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/ast.dart ('k') | pkg/kernel/lib/text/ast_to_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698