OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 unit.getDirectives().add(importDirective(src_package + "source.dart", null))
; | 678 unit.getDirectives().add(importDirective(src_package + "source.dart", null))
; |
679 unit.getDirectives().add(importDirective(src_package + "error.dart", null)); | 679 unit.getDirectives().add(importDirective(src_package + "error.dart", null)); |
680 unit.getDirectives().add(importDirective(src_package + "scanner.dart", null)
); | 680 unit.getDirectives().add(importDirective(src_package + "scanner.dart", null)
); |
681 unit.getDirectives().add(importDirective(src_package + "ast.dart", null)); | 681 unit.getDirectives().add(importDirective(src_package + "ast.dart", null)); |
682 unit.getDirectives().add(importDirective(src_package + "parser.dart", null))
; | 682 unit.getDirectives().add(importDirective(src_package + "parser.dart", null))
; |
683 unit.getDirectives().add(importDirective(src_package + "utilities_dart.dart"
, null)); | 683 unit.getDirectives().add(importDirective(src_package + "utilities_dart.dart"
, null)); |
684 unit.getDirectives().add(importDirective("package:unittest/unittest.dart", "
_ut")); | 684 unit.getDirectives().add(importDirective("package:unittest/unittest.dart", "
_ut")); |
685 unit.getDirectives().add(importDirective("test_support.dart", null)); | 685 unit.getDirectives().add(importDirective("test_support.dart", null)); |
686 unit.getDirectives().add( | 686 unit.getDirectives().add( |
687 importDirective("scanner_test.dart", null, importShowCombinator("TokenFa
ctory"))); | 687 importDirective("scanner_test.dart", null, importShowCombinator("TokenFa
ctory"))); |
| 688 unit.getDirectives().add( |
| 689 importDirective("ast_test.dart", null, importShowCombinator("ASTFactory"
))); |
688 List<Statement> mainStatements = Lists.newArrayList(); | 690 List<Statement> mainStatements = Lists.newArrayList(); |
689 for (Entry<File, List<CompilationUnitMember>> entry : context.getFileToMembe
rs().entrySet()) { | 691 for (Entry<File, List<CompilationUnitMember>> entry : context.getFileToMembe
rs().entrySet()) { |
690 File file = entry.getKey(); | 692 File file = entry.getKey(); |
691 if (isEngineTestPath(file, "parser/")) { | 693 if (isEngineTestPath(file, "parser/")) { |
692 List<CompilationUnitMember> unitMembers = entry.getValue(); | 694 List<CompilationUnitMember> unitMembers = entry.getValue(); |
693 for (CompilationUnitMember unitMember : unitMembers) { | 695 for (CompilationUnitMember unitMember : unitMembers) { |
694 boolean isTestSuite = EngineSemanticProcessor.gatherTestSuites(mainSta
tements, unitMember); | 696 boolean isTestSuite = EngineSemanticProcessor.gatherTestSuites(mainSta
tements, unitMember); |
695 if (!isTestSuite) { | 697 if (!isTestSuite) { |
696 unit.getDeclarations().add(unitMember); | 698 unit.getDeclarations().add(unitMember); |
697 } | 699 } |
(...skipping 11 matching lines...) Expand all Loading... |
709 unit.getDirectives().add(importDirective("java_core.dart", null)); | 711 unit.getDirectives().add(importDirective("java_core.dart", null)); |
710 unit.getDirectives().add(importDirective("java_engine.dart", null)); | 712 unit.getDirectives().add(importDirective("java_engine.dart", null)); |
711 unit.getDirectives().add(importDirective("instrumentation.dart", null)); | 713 unit.getDirectives().add(importDirective("instrumentation.dart", null)); |
712 unit.getDirectives().add(importDirective("source.dart", null)); | 714 unit.getDirectives().add(importDirective("source.dart", null)); |
713 unit.getDirectives().add(importDirective("error.dart", null)); | 715 unit.getDirectives().add(importDirective("error.dart", null)); |
714 unit.getDirectives().add(importDirective("scanner.dart", "sc")); | 716 unit.getDirectives().add(importDirective("scanner.dart", "sc")); |
715 unit.getDirectives().add(importDirective("utilities_dart.dart", null)); | 717 unit.getDirectives().add(importDirective("utilities_dart.dart", null)); |
716 unit.getDirectives().add(importDirective("ast.dart", null)); | 718 unit.getDirectives().add(importDirective("ast.dart", null)); |
717 unit.getDirectives().add( | 719 unit.getDirectives().add( |
718 importDirective("parser.dart", null, importShowCombinator("Parser", "Par
serErrorCode"))); | 720 importDirective("parser.dart", null, importShowCombinator("Parser", "Par
serErrorCode"))); |
719 unit.getDirectives().add(importDirective("sdk.dart", null, importShowCombina
tor("DartSdk"))); | 721 unit.getDirectives().add( |
| 722 importDirective("sdk.dart", null, importShowCombinator("DartSdk", "SdkLi
brary"))); |
720 unit.getDirectives().add( | 723 unit.getDirectives().add( |
721 importDirective( | 724 importDirective( |
722 "element.dart", | 725 "element.dart", |
723 null, | 726 null, |
724 importHideCombinator("HideCombinator", "ShowCombinator"))); | 727 importHideCombinator("Annotation", "HideCombinator", "ShowCombinator
"))); |
725 unit.getDirectives().add(importDirective("html.dart", "ht")); | 728 unit.getDirectives().add(importDirective("html.dart", "ht")); |
726 unit.getDirectives().add(importDirective("engine.dart", null)); | 729 unit.getDirectives().add(importDirective("engine.dart", null)); |
727 unit.getDirectives().add(importDirective("constant.dart", null)); | 730 unit.getDirectives().add(importDirective("constant.dart", null)); |
728 for (CompilationUnitMember member : dartUnit.getDeclarations()) { | 731 for (CompilationUnitMember member : dartUnit.getDeclarations()) { |
729 File file = context.getMemberToFile().get(member); | 732 File file = context.getMemberToFile().get(member); |
730 if (isEnginePath(file, "resolver/") || isEnginePath(file, "internal/resolv
er/") | 733 if (isEnginePath(file, "resolver/") || isEnginePath(file, "internal/resolv
er/") |
731 || isEnginePath(file, "internal/builder/") || isEnginePath(file, "inte
rnal/scope/") | 734 || isEnginePath(file, "internal/builder/") || isEnginePath(file, "inte
rnal/scope/") |
732 || isEnginePath(file, "internal/verifier/")) { | 735 || isEnginePath(file, "internal/verifier/")) { |
733 unit.getDeclarations().add(member); | 736 unit.getDeclarations().add(member); |
734 } | 737 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 } | 863 } |
861 } | 864 } |
862 } | 865 } |
863 } | 866 } |
864 EngineSemanticProcessor.addMain(unit, mainStatements); | 867 EngineSemanticProcessor.addMain(unit, mainStatements); |
865 return unit; | 868 return unit; |
866 } | 869 } |
867 | 870 |
868 private static CompilationUnit buildSdkIoLibrary() throws Exception { | 871 private static CompilationUnit buildSdkIoLibrary() throws Exception { |
869 CompilationUnit unit = new CompilationUnit(null, null, null, null, null); | 872 CompilationUnit unit = new CompilationUnit(null, null, null, null, null); |
870 unit.getDirectives().add(libraryDirective("engine", "sdk")); | 873 unit.getDirectives().add(libraryDirective("engine", "sdk", "io")); |
871 unit.getDirectives().add(importDirective("dart:io", null)); | 874 unit.getDirectives().add(importDirective("dart:io", null)); |
872 unit.getDirectives().add(importDirective("java_core.dart", null)); | 875 unit.getDirectives().add(importDirective("java_core.dart", null)); |
873 unit.getDirectives().add(importDirective("java_io.dart", null)); | 876 unit.getDirectives().add(importDirective("java_io.dart", null)); |
874 unit.getDirectives().add(importDirective("java_engine.dart", null)); | 877 unit.getDirectives().add(importDirective("java_engine.dart", null)); |
875 unit.getDirectives().add(importDirective("java_engine_io.dart", null)); | 878 unit.getDirectives().add(importDirective("java_engine_io.dart", null)); |
876 unit.getDirectives().add(importDirective("source_io.dart", null)); | 879 unit.getDirectives().add(importDirective("source_io.dart", null)); |
877 unit.getDirectives().add(importDirective("error.dart", null)); | 880 unit.getDirectives().add(importDirective("error.dart", null)); |
878 unit.getDirectives().add(importDirective("scanner.dart", null)); | 881 unit.getDirectives().add(importDirective("scanner.dart", null)); |
879 unit.getDirectives().add(importDirective("ast.dart", null)); | 882 unit.getDirectives().add(importDirective("ast.dart", null)); |
880 unit.getDirectives().add(importDirective("parser.dart", null)); | 883 unit.getDirectives().add(importDirective("parser.dart", null)); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 unit.getDirectives().add(importDirective(src_package + "scanner.dart", null)
); | 992 unit.getDirectives().add(importDirective(src_package + "scanner.dart", null)
); |
990 unit.getDirectives().add( | 993 unit.getDirectives().add( |
991 importDirective( | 994 importDirective( |
992 src_package + "element.dart", | 995 src_package + "element.dart", |
993 null, | 996 null, |
994 importShowCombinator("InterfaceType", "MethodElement", "PropertyAcce
ssorElement"))); | 997 importShowCombinator("InterfaceType", "MethodElement", "PropertyAcce
ssorElement"))); |
995 unit.getDirectives().add( | 998 unit.getDirectives().add( |
996 importDirective( | 999 importDirective( |
997 src_package + "engine.dart", | 1000 src_package + "engine.dart", |
998 null, | 1001 null, |
999 importShowCombinator("AnalysisContext", "AnalysisContextImpl"))); | 1002 importShowCombinator("AnalysisContext", "AnalysisContextImpl", "Reco
rdingErrorListener"))); |
1000 unit.getDirectives().add(importDirective("package:unittest/unittest.dart", "
_ut")); | 1003 unit.getDirectives().add(importDirective("package:unittest/unittest.dart", "
_ut")); |
1001 List<Statement> mainStatements = Lists.newArrayList(); | 1004 List<Statement> mainStatements = Lists.newArrayList(); |
1002 for (Entry<File, List<CompilationUnitMember>> entry : context.getFileToMembe
rs().entrySet()) { | 1005 for (Entry<File, List<CompilationUnitMember>> entry : context.getFileToMembe
rs().entrySet()) { |
1003 File file = entry.getKey(); | 1006 File file = entry.getKey(); |
1004 if (isEngineTestPath(file, "error/") || isEngineTestPath(file, "EngineTest
Case.java")) { | 1007 if (isEngineTestPath(file, "error/") || isEngineTestPath(file, "EngineTest
Case.java")) { |
1005 addNotRemovedCompiationUnitEntries(unit, entry.getValue()); | 1008 addNotRemovedCompiationUnitEntries(unit, entry.getValue()); |
1006 } | 1009 } |
1007 } | 1010 } |
1008 EngineSemanticProcessor.addMain(unit, mainStatements); | 1011 EngineSemanticProcessor.addMain(unit, mainStatements); |
1009 return unit; | 1012 return unit; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 | 1045 |
1043 /** | 1046 /** |
1044 * @param enginePackage the sub-package in <code>com/google/dart/engine</code>
. | 1047 * @param enginePackage the sub-package in <code>com/google/dart/engine</code>
. |
1045 * @return <code>true</code> if given {@link File} is located in sub-package o
f Engine project. | 1048 * @return <code>true</code> if given {@link File} is located in sub-package o
f Engine project. |
1046 */ | 1049 */ |
1047 private static boolean isEngineTestPath(File file, String enginePackage) { | 1050 private static boolean isEngineTestPath(File file, String enginePackage) { |
1048 return file.getAbsolutePath().startsWith( | 1051 return file.getAbsolutePath().startsWith( |
1049 engineTestFolder.getAbsolutePath() + "/com/google/dart/engine/" + engine
Package); | 1052 engineTestFolder.getAbsolutePath() + "/com/google/dart/engine/" + engine
Package); |
1050 } | 1053 } |
1051 } | 1054 } |
OLD | NEW |