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

Side by Side Diff: pkg/analyzer/lib/src/generated/testing/ast_factory.dart

Issue 1672413002: Add summary support for annotations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | pkg/analyzer/lib/src/summary/format.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library analyzer.src.generated.testing.ast_factory; 5 library analyzer.src.generated.testing.ast_factory;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/src/dart/ast/ast.dart'; 9 import 'package:analyzer/src/dart/ast/ast.dart';
10 import 'package:analyzer/src/generated/scanner.dart'; 10 import 'package:analyzer/src/generated/scanner.dart';
(...skipping 17 matching lines...) Expand all
28 new AdjacentStrings(strings); 28 new AdjacentStrings(strings);
29 29
30 static Annotation annotation(Identifier name) => new Annotation( 30 static Annotation annotation(Identifier name) => new Annotation(
31 TokenFactory.tokenFromType(TokenType.AT), name, null, null, null); 31 TokenFactory.tokenFromType(TokenType.AT), name, null, null, null);
32 32
33 static Annotation annotation2(Identifier name, 33 static Annotation annotation2(Identifier name,
34 SimpleIdentifier constructorName, ArgumentList arguments) => 34 SimpleIdentifier constructorName, ArgumentList arguments) =>
35 new Annotation( 35 new Annotation(
36 TokenFactory.tokenFromType(TokenType.AT), 36 TokenFactory.tokenFromType(TokenType.AT),
37 name, 37 name,
38 TokenFactory.tokenFromType(TokenType.PERIOD), 38 constructorName == null
39 ? null
40 : TokenFactory.tokenFromType(TokenType.PERIOD),
39 constructorName, 41 constructorName,
40 arguments); 42 arguments);
41 43
42 static ArgumentList argumentList([List<Expression> arguments]) => 44 static ArgumentList argumentList([List<Expression> arguments]) =>
43 new ArgumentList(TokenFactory.tokenFromType(TokenType.OPEN_PAREN), 45 new ArgumentList(TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
44 arguments, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN)); 46 arguments, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
45 47
46 static AsExpression asExpression(Expression expression, TypeName type) => 48 static AsExpression asExpression(Expression expression, TypeName type) =>
47 new AsExpression( 49 new AsExpression(
48 expression, TokenFactory.tokenFromKeyword(Keyword.AS), type); 50 expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 expression, 1263 expression,
1262 TokenFactory.tokenFromType(TokenType.SEMICOLON)); 1264 TokenFactory.tokenFromType(TokenType.SEMICOLON));
1263 1265
1264 static YieldStatement yieldStatement(Expression expression) => 1266 static YieldStatement yieldStatement(Expression expression) =>
1265 new YieldStatement( 1267 new YieldStatement(
1266 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), 1268 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
1267 null, 1269 null,
1268 expression, 1270 expression,
1269 TokenFactory.tokenFromType(TokenType.SEMICOLON)); 1271 TokenFactory.tokenFromType(TokenType.SEMICOLON));
1270 } 1272 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698