Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/builder/ast_factory.dart |
| diff --git a/pkg/front_end/lib/src/fasta/builder/ast_factory.dart b/pkg/front_end/lib/src/fasta/builder/ast_factory.dart |
| index 2559d8971ba154c8c2dd95973d901d244039fa78..ad404ecd04ede207f177a2aa456d7187a139a3f8 100644 |
| --- a/pkg/front_end/lib/src/fasta/builder/ast_factory.dart |
| +++ b/pkg/front_end/lib/src/fasta/builder/ast_factory.dart |
| @@ -2,6 +2,7 @@ |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| +import 'package:front_end/src/fasta/scanner/token.dart' show Token; |
|
ahe
2017/04/26 08:34:36
If you import package:front_end/src/fasta/scanner.
Paul Berry
2017/04/26 20:20:52
Done.
|
| import 'package:kernel/ast.dart'; |
| /// An abstract class containing factory methods that create AST objects. |
| @@ -34,29 +35,29 @@ import 'package:kernel/ast.dart'; |
| /// exact tokens that were used to specify a type. |
| abstract class AstFactory { |
| /// Creates a statement block. |
| - Block block(List<Statement> statements, int charOffset); |
| + Block block(List<Statement> statements, Token beginToken); |
| /// Creates a field. |
| Field field(Name name, int charOffset, {String fileUri}); |
|
Paul Berry
2017/04/25 12:37:52
Note: I realized as I was going through this exerc
|
| /// Creates an integer literal. |
| - IntLiteral intLiteral(value, int charOffset); |
| + IntLiteral intLiteral(value, Token token); |
| /// Creates a list literal expression. |
| /// |
| /// If the list literal did not have an explicitly declared type argument, |
| /// [typeArgument] should be `null`. |
| ListLiteral listLiteral(List<Expression> expressions, DartType typeArgument, |
| - bool isConst, int charOffset); |
| + bool isConst, Token token); |
| /// Creates a null literal expression. |
| - NullLiteral nullLiteral(int charOffset); |
| + NullLiteral nullLiteral(Token token); |
| /// Creates a return statement. |
| - Statement returnStatement(Expression expression, int charOffset); |
| + Statement returnStatement(Expression expression, Token token); |
| /// Creates a read of a static variable. |
| - StaticGet staticGet(Member readTarget, int offset); |
| + StaticGet staticGet(Member readTarget, Token token); |
| /// Creates a variable declaration statement declaring one variable. |
| /// |
| @@ -67,10 +68,10 @@ abstract class AstFactory { |
| /// |
| /// If the variable declaration did not have an explicitly declared type, |
| /// [type] should be `null`. |
| - VariableDeclaration variableDeclaration(String name, int charOffset, |
| + VariableDeclaration variableDeclaration(String name, Token token, |
| {DartType type, |
| Expression initializer, |
| - int equalsCharOffset = TreeNode.noOffset, |
| + Token equalsToken, |
| bool isFinal: false, |
| bool isConst: false}); |
| } |