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

Side by Side Diff: pkg/front_end/lib/src/fasta/builder/ast_factory.dart

Issue 2842273002: Remove AstFactory.field() (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
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:front_end/src/fasta/scanner.dart' show Token; 5 import 'package:front_end/src/fasta/scanner.dart' show Token;
6 import 'package:front_end/src/fasta/type_inference/type_promotion.dart'; 6 import 'package:front_end/src/fasta/type_inference/type_promotion.dart';
7 import 'package:kernel/ast.dart'; 7 import 'package:kernel/ast.dart';
8 8
9 /// An abstract class containing factory methods that create AST objects. 9 /// An abstract class containing factory methods that create AST objects.
10 /// 10 ///
(...skipping 23 matching lines...) Expand all
34 /// TODO(paulberry): in order to interface with analyzer, we'll need to 34 /// TODO(paulberry): in order to interface with analyzer, we'll need to
35 /// shadow-ify [DartType], since analyzer ASTs need to be able to record the 35 /// shadow-ify [DartType], since analyzer ASTs need to be able to record the
36 /// exact tokens that were used to specify a type. 36 /// exact tokens that were used to specify a type.
37 abstract class AstFactory<V> { 37 abstract class AstFactory<V> {
38 /// Creates a statement block. 38 /// Creates a statement block.
39 Block block(List<Statement> statements, Token beginToken); 39 Block block(List<Statement> statements, Token beginToken);
40 40
41 /// Creates an expression statement. 41 /// Creates an expression statement.
42 ExpressionStatement expressionStatement(Expression expression); 42 ExpressionStatement expressionStatement(Expression expression);
43 43
44 /// Creates a field.
45 Field field(Name name, int charOffset, {String fileUri});
46
47 /// Creates a function expression. 44 /// Creates a function expression.
48 FunctionExpression functionExpression(FunctionNode function, Token token); 45 FunctionExpression functionExpression(FunctionNode function, Token token);
49 46
50 /// Creates an `if` statement. 47 /// Creates an `if` statement.
51 Statement ifStatement( 48 Statement ifStatement(
52 Expression condition, Statement thenPart, Statement elsePart); 49 Expression condition, Statement thenPart, Statement elsePart);
53 50
54 /// Creates an integer literal. 51 /// Creates an integer literal.
55 IntLiteral intLiteral(value, Token token); 52 IntLiteral intLiteral(value, Token token);
56 53
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 {DartType type, 85 {DartType type,
89 Expression initializer, 86 Expression initializer,
90 Token equalsToken, 87 Token equalsToken,
91 bool isFinal: false, 88 bool isFinal: false,
92 bool isConst: false}); 89 bool isConst: false});
93 90
94 /// Creates a read of a local variable. 91 /// Creates a read of a local variable.
95 variableGet(VariableDeclaration variable, TypePromotionFact<V> fact, 92 variableGet(VariableDeclaration variable, TypePromotionFact<V> fact,
96 TypePromotionScope scope, Token token); 93 TypePromotionScope scope, Token token);
97 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698