| 1106 |
converter.buildCommentsTable(compilationUnit, comments); |
converter.buildCommentsTable(compilationUnit, comments); |
| 1107 |
} |
} |
| 1108 |
compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); |
compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); |
| 1109 |
|
if (nodes != null) { |
| 1110 |
|
// source has no syntax error or the statement recovery is enabled |
| 1111 |
TypeDeclaration typeDeclaration = converter.convert(nodes); |
TypeDeclaration typeDeclaration = converter.convert(nodes); |
| 1112 |
typeDeclaration.setSourceRange(this.sourceOffset, this.sourceOffset + this.sourceLength); |
typeDeclaration.setSourceRange(this.sourceOffset, this.sourceOffset + this.sourceLength); |
| 1113 |
rootNodeToCompilationUnit(typeDeclaration.getAST(), compilationUnit, typeDeclaration, codeSnippetParsingUtil.recordedParsingInformation, null); |
rootNodeToCompilationUnit(typeDeclaration.getAST(), compilationUnit, typeDeclaration, codeSnippetParsingUtil.recordedParsingInformation, null); |
| 1114 |
ast.setDefaultNodeFlag(0); |
ast.setDefaultNodeFlag(0); |
| 1115 |
ast.setOriginalModificationCount(ast.modificationCount()); |
ast.setOriginalModificationCount(ast.modificationCount()); |
| 1116 |
return typeDeclaration; |
return typeDeclaration; |
| 1117 |
|
} else { |
| 1118 |
|
// source has syntax error and the statement recovery is disabled |
| 1119 |
|
CategorizedProblem[] problems = recordedParsingInformation.problems; |
| 1120 |
|
if (problems != null) { |
| 1121 |
|
compilationUnit.setProblems(problems); |
| 1122 |
|
} |
| 1123 |
|
ast.setDefaultNodeFlag(0); |
| 1124 |
|
ast.setOriginalModificationCount(ast.modificationCount()); |
| 1125 |
|
return compilationUnit; |
| 1126 |
|
} |
| 1127 |
} |
} |
| 1128 |
throw new IllegalStateException(); |
throw new IllegalStateException(); |
| 1129 |
} |
} |