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

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

Issue 2768533002: Fasta type inference prototype #2
Patch Set: Merge origin/master Created 3 years, 9 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
(Empty)
1 import 'package:kernel/ast.dart' show DartType;
2
3 import '../builder/ast_factory.dart' as builder;
4 import '../builder/shadow_ast.dart' as builder;
5 import 'shadow_ast.dart';
6
7 class AstFactory implements builder.AstFactory {
8 Block block(List<builder.Statement> statements, int charOffset) {
9 return new Block(statements)..fileOffset = charOffset;
10 }
11
12 IntLiteral intLiteral(value, int charOffset) {
13 return new IntLiteral(value)..fileOffset = charOffset;
14 }
15
16 ListLiteral listLiteral(List<builder.Expression> expressions,
17 DartType typeArgument, bool isConst, int charOffset) {
18 return new ListLiteral(expressions,
19 typeArgument: typeArgument, isConst: isConst)..fileOffset = charOffset;
20 }
21
22 NullLiteral nullLiteral(int charOffset) {
23 return new NullLiteral()..fileOffset = charOffset;
24 }
25
26 ReturnStatement returnStatement(
27 builder.Expression expression, int charOffset) {
28 return new ReturnStatement(expression)..fileOffset = charOffset;
29 }
30
31 VariableDeclaration variableDeclaration(String name,
32 {DartType type,
33 builder.Expression initializer,
34 int charOffset,
35 bool isFinal: false,
36 bool isConst: false}) {
37 return new VariableDeclaration(name,
38 type: type,
39 initializer: initializer,
40 isFinal: isFinal,
41 isConst: isConst)..fileEqualsOffset = charOffset;
42 }
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698