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

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

Issue 1406253004: Lexical support for configurable imports (DEP 40) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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) 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 engine.testing.ast_factory; 5 library engine.testing.ast_factory;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/scanner.dart'; 9 import 'package:analyzer/src/generated/scanner.dart';
10 import 'package:analyzer/src/generated/testing/token_factory.dart'; 10 import 'package:analyzer/src/generated/testing/token_factory.dart';
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 return enumDeclaration(identifier3(name), constants); 424 return enumDeclaration(identifier3(name), constants);
425 } 425 }
426 426
427 static ExportDirective exportDirective(List<Annotation> metadata, String uri, 427 static ExportDirective exportDirective(List<Annotation> metadata, String uri,
428 [List<Combinator> combinators]) => 428 [List<Combinator> combinators]) =>
429 new ExportDirective( 429 new ExportDirective(
430 null, 430 null,
431 metadata, 431 metadata,
432 TokenFactory.tokenFromKeyword(Keyword.EXPORT), 432 TokenFactory.tokenFromKeyword(Keyword.EXPORT),
433 string2(uri), 433 string2(uri),
434 null,
434 combinators, 435 combinators,
435 TokenFactory.tokenFromType(TokenType.SEMICOLON)); 436 TokenFactory.tokenFromType(TokenType.SEMICOLON));
436 437
437 static ExportDirective exportDirective2(String uri, 438 static ExportDirective exportDirective2(String uri,
438 [List<Combinator> combinators]) => 439 [List<Combinator> combinators]) =>
439 exportDirective(null, uri, combinators); 440 exportDirective(null, uri, combinators);
440 441
441 static ExpressionFunctionBody expressionFunctionBody(Expression expression) => 442 static ExpressionFunctionBody expressionFunctionBody(Expression expression) =>
442 new ExpressionFunctionBody( 443 new ExpressionFunctionBody(
443 null, 444 null,
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), types); 651 TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), types);
651 652
652 static ImportDirective importDirective( 653 static ImportDirective importDirective(
653 List<Annotation> metadata, String uri, bool isDeferred, String prefix, 654 List<Annotation> metadata, String uri, bool isDeferred, String prefix,
654 [List<Combinator> combinators]) => 655 [List<Combinator> combinators]) =>
655 new ImportDirective( 656 new ImportDirective(
656 null, 657 null,
657 metadata, 658 metadata,
658 TokenFactory.tokenFromKeyword(Keyword.IMPORT), 659 TokenFactory.tokenFromKeyword(Keyword.IMPORT),
659 string2(uri), 660 string2(uri),
661 null,
660 !isDeferred ? null : TokenFactory.tokenFromKeyword(Keyword.DEFERRED), 662 !isDeferred ? null : TokenFactory.tokenFromKeyword(Keyword.DEFERRED),
661 prefix == null ? null : TokenFactory.tokenFromKeyword(Keyword.AS), 663 prefix == null ? null : TokenFactory.tokenFromKeyword(Keyword.AS),
662 prefix == null ? null : identifier3(prefix), 664 prefix == null ? null : identifier3(prefix),
663 combinators, 665 combinators,
664 TokenFactory.tokenFromType(TokenType.SEMICOLON)); 666 TokenFactory.tokenFromType(TokenType.SEMICOLON));
665 667
666 static ImportDirective importDirective2( 668 static ImportDirective importDirective2(
667 String uri, bool isDeferred, String prefix, 669 String uri, bool isDeferred, String prefix,
668 [List<Combinator> combinators]) => 670 [List<Combinator> combinators]) =>
669 importDirective(null, uri, isDeferred, prefix, combinators); 671 importDirective(null, uri, isDeferred, prefix, combinators);
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 expression, 1253 expression,
1252 TokenFactory.tokenFromType(TokenType.SEMICOLON)); 1254 TokenFactory.tokenFromType(TokenType.SEMICOLON));
1253 1255
1254 static YieldStatement yieldStatement(Expression expression) => 1256 static YieldStatement yieldStatement(Expression expression) =>
1255 new YieldStatement( 1257 new YieldStatement(
1256 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), 1258 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
1257 null, 1259 null,
1258 expression, 1260 expression,
1259 TokenFactory.tokenFromType(TokenType.SEMICOLON)); 1261 TokenFactory.tokenFromType(TokenType.SEMICOLON));
1260 } 1262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698