Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:kernel/ast.dart'; | 5 import 'package:kernel/ast.dart'; |
| 6 | 6 |
| 7 import '../builder/ast_factory.dart'; | 7 import '../builder/ast_factory.dart'; |
| 8 import 'kernel_shadow_ast.dart'; | 8 import 'kernel_shadow_ast.dart'; |
| 9 | 9 |
| 10 /// Concrete implementation of [builder.AstFactory] for building a kernel AST. | 10 /// Concrete implementation of [builder.AstFactory] for building a kernel AST. |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 | 34 |
| 35 @override | 35 @override |
| 36 KernelReturnStatement returnStatement(Expression expression, int charOffset) { | 36 KernelReturnStatement returnStatement(Expression expression, int charOffset) { |
| 37 return new KernelReturnStatement(expression)..fileOffset = charOffset; | 37 return new KernelReturnStatement(expression)..fileOffset = charOffset; |
| 38 } | 38 } |
| 39 | 39 |
| 40 @override | 40 @override |
| 41 KernelVariableDeclaration variableDeclaration(String name, | 41 KernelVariableDeclaration variableDeclaration(String name, |
| 42 {DartType type, | 42 {DartType type, |
| 43 Expression initializer, | 43 Expression initializer, |
| 44 int charOffset, | 44 int charOffset = TreeNode.noOffset, |
|
ahe
2017/04/20 09:45:29
Perhaps this should be a required parameter?
Paul Berry
2017/04/20 09:52:57
I don't know--does it make sense for a variableDec
ahe
2017/04/20 11:38:24
I think both of those are mistakes that would be c
| |
| 45 int equalsCharOffset = TreeNode.noOffset, | |
| 45 bool isFinal: false, | 46 bool isFinal: false, |
| 46 bool isConst: false}) { | 47 bool isConst: false}) { |
| 47 return new KernelVariableDeclaration(name, | 48 return new KernelVariableDeclaration(name, |
| 48 type: type, | 49 type: type, |
| 49 initializer: initializer, | 50 initializer: initializer, |
| 50 isFinal: isFinal, | 51 isFinal: isFinal, |
| 51 isConst: isConst) | 52 isConst: isConst) |
| 52 ..fileEqualsOffset = charOffset; | 53 ..fileOffset = charOffset |
| 54 ..fileEqualsOffset = equalsCharOffset; | |
| 53 } | 55 } |
| 54 } | 56 } |
| OLD | NEW |