|
19 | 19 | import com.google.gwt.core.ext.UnableToCompleteException; |
20 | 20 | import com.google.gwt.dev.CompilerContext; |
21 | 21 | import com.google.gwt.dev.jdt.TypeRefVisitor; |
| 22 | +import com.google.gwt.dev.jjs.InternalCompilerException; |
22 | 23 | import com.google.gwt.dev.jjs.ast.JDeclaredType; |
23 | 24 | import com.google.gwt.dev.util.arg.SourceLevel; |
24 | 25 | import com.google.gwt.dev.util.collect.Lists; |
@@ -197,11 +198,17 @@ public ParserImpl(ProblemReporter problemReporter, boolean optimizeStringLiteral |
197 | 198 | @Override |
198 | 199 | public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit, |
199 | 200 | CompilationResult compilationResult) { |
200 | | - // Never dietParse(), otherwise GwtIncompatible annotations in anonymoous inner classes |
| 201 | + // Never dietParse(), otherwise GwtIncompatible annotations in anonymous inner classes |
201 | 202 | // would be ignored. |
202 | 203 | boolean saveDiet = this.diet; |
203 | 204 | this.diet = false; |
204 | | - CompilationUnitDeclaration decl = super.parse(sourceUnit, compilationResult); |
| 205 | + CompilationUnitDeclaration decl; |
| 206 | + try { |
| 207 | + decl = super.parse(sourceUnit, compilationResult); |
| 208 | + } catch (RuntimeException ex) { |
| 209 | + throw new InternalCompilerException("Problem parsing " |
| 210 | + + new String(sourceUnit.getFileName()), ex); |
| 211 | + } |
205 | 212 | this.diet = saveDiet; |
206 | 213 | // Remove @GwtIncompatible classes and members. |
207 | 214 | // It is safe to remove @GwtIncompatible types, fields and methods on incomplete ASTs due |
|
0 commit comments