OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
Brian Wilkerson
2012/06/25 14:24:38
nit: copyright year
scheglov
2012/06/26 19:46:34
Done.
| |
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 package com.google.dart.compiler.common; | 5 package com.google.dart.compiler.common; |
6 | 6 |
7 import com.google.common.collect.Sets; | |
7 import com.google.dart.compiler.AbstractSourceFileTest; | 8 import com.google.dart.compiler.AbstractSourceFileTest; |
8 import com.google.dart.compiler.DartCompilationError; | 9 import com.google.dart.compiler.DartCompilationError; |
9 import com.google.dart.compiler.DartCompilerListener; | 10 import com.google.dart.compiler.DartCompilerListener; |
10 import com.google.dart.compiler.ErrorSeverity; | 11 import com.google.dart.compiler.ErrorSeverity; |
11 import com.google.dart.compiler.LibrarySource; | 12 import com.google.dart.compiler.LibrarySource; |
12 import com.google.dart.compiler.UrlLibrarySource; | 13 import com.google.dart.compiler.UrlLibrarySource; |
13 import com.google.dart.compiler.ast.LibraryNode; | 14 import com.google.dart.compiler.ast.LibraryNode; |
14 import com.google.dart.compiler.ast.LibraryUnit; | 15 import com.google.dart.compiler.ast.LibraryUnit; |
15 import com.google.dart.compiler.parser.DartParser; | 16 import com.google.dart.compiler.parser.DartParser; |
16 | 17 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 // Ignore warnings when testing. | 101 // Ignore warnings when testing. |
101 if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.WARNING) { | 102 if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.WARNING) { |
102 return; | 103 return; |
103 } | 104 } |
104 // Rethrow error. | 105 // Rethrow error. |
105 throw new RuntimeException(event.getMessage()); | 106 throw new RuntimeException(event.getMessage()); |
106 } | 107 } |
107 }; | 108 }; |
108 | 109 |
109 try { | 110 try { |
110 libUnit = DartParser.getSourceParser(lib, listener).preProcessLibraryDir ectives(lib); | 111 libUnit = new DartParser( |
112 lib, | |
113 DartParser.read(lib), | |
114 false, | |
115 Sets.<String>newHashSet(), | |
116 listener, | |
117 null).preProcessLibraryDirectives(lib); | |
111 } catch (IOException ioEx) { | 118 } catch (IOException ioEx) { |
112 libUnit = null; | 119 libUnit = null; |
113 } | 120 } |
114 } | 121 } |
115 return libUnit; | 122 return libUnit; |
116 } | 123 } |
117 } | 124 } |
OLD | NEW |