Lines 982-987
Link Here
|
982 |
compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); |
982 |
compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); |
983 |
if (constructorDeclaration != null) { |
983 |
if (constructorDeclaration != null) { |
984 |
Block block = ast.newBlock(); |
984 |
Block block = ast.newBlock(); |
|
|
985 |
block.setSourceRange(this.sourceOffset, this.sourceOffset + this.sourceLength); |
985 |
org.eclipse.jdt.internal.compiler.ast.Statement[] statements = constructorDeclaration.statements; |
986 |
org.eclipse.jdt.internal.compiler.ast.Statement[] statements = constructorDeclaration.statements; |
986 |
if (statements != null) { |
987 |
if (statements != null) { |
987 |
int statementsLength = statements.length; |
988 |
int statementsLength = statements.length; |
Lines 997-1005
Link Here
|
997 |
} |
998 |
} |
998 |
} |
999 |
} |
999 |
rootNodeToCompilationUnit(ast, compilationUnit, block, recordedParsingInformation, data); |
1000 |
rootNodeToCompilationUnit(ast, compilationUnit, block, recordedParsingInformation, data); |
1000 |
if (data != null) { |
|
|
1001 |
block.setFlags(block.getFlags() | ASTNode.RECOVERED); |
1002 |
} |
1003 |
ast.setDefaultNodeFlag(0); |
1001 |
ast.setDefaultNodeFlag(0); |
1004 |
ast.setOriginalModificationCount(ast.modificationCount()); |
1002 |
ast.setOriginalModificationCount(ast.modificationCount()); |
1005 |
return block; |
1003 |
return block; |
Lines 1045-1050
Link Here
|
1045 |
compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); |
1043 |
compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); |
1046 |
if (nodes != null) { |
1044 |
if (nodes != null) { |
1047 |
TypeDeclaration typeDeclaration = converter.convert(nodes); |
1045 |
TypeDeclaration typeDeclaration = converter.convert(nodes); |
|
|
1046 |
typeDeclaration.setSourceRange(this.sourceOffset, this.sourceOffset + this.sourceLength); |
1048 |
rootNodeToCompilationUnit(typeDeclaration.getAST(), compilationUnit, typeDeclaration, codeSnippetParsingUtil.recordedParsingInformation, null); |
1047 |
rootNodeToCompilationUnit(typeDeclaration.getAST(), compilationUnit, typeDeclaration, codeSnippetParsingUtil.recordedParsingInformation, null); |
1049 |
ast.setDefaultNodeFlag(0); |
1048 |
ast.setDefaultNodeFlag(0); |
1050 |
ast.setOriginalModificationCount(ast.modificationCount()); |
1049 |
ast.setOriginalModificationCount(ast.modificationCount()); |
Lines 1078-1086
Link Here
|
1078 |
if (problemsCount != 0) { |
1077 |
if (problemsCount != 0) { |
1079 |
// propagate and record problems |
1078 |
// propagate and record problems |
1080 |
final CategorizedProblem[] problems = recordedParsingInformation.problems; |
1079 |
final CategorizedProblem[] problems = recordedParsingInformation.problems; |
1081 |
for (int i = 0, max = block.statements().size(); i < max; i++) { |
1080 |
propagateErrors(block, problems, data); |
1082 |
propagateErrors((ASTNode) block.statements().get(i), problems, data); |
|
|
1083 |
} |
1084 |
compilationUnit.setProblems(problems); |
1081 |
compilationUnit.setProblems(problems); |
1085 |
} |
1082 |
} |
1086 |
TypeDeclaration typeDeclaration = ast.newTypeDeclaration(); |
1083 |
TypeDeclaration typeDeclaration = ast.newTypeDeclaration(); |
Lines 1096-1104
Link Here
|
1096 |
if (problemsCount != 0) { |
1093 |
if (problemsCount != 0) { |
1097 |
// propagate and record problems |
1094 |
// propagate and record problems |
1098 |
final CategorizedProblem[] problems = recordedParsingInformation.problems; |
1095 |
final CategorizedProblem[] problems = recordedParsingInformation.problems; |
1099 |
for (int i = 0, max = typeDeclaration.bodyDeclarations().size(); i < max; i++) { |
1096 |
propagateErrors(typeDeclaration, problems, data); |
1100 |
propagateErrors((ASTNode) typeDeclaration.bodyDeclarations().get(i), problems, data); |
|
|
1101 |
} |
1102 |
compilationUnit.setProblems(problems); |
1097 |
compilationUnit.setProblems(problems); |
1103 |
} |
1098 |
} |
1104 |
compilationUnit.types().add(typeDeclaration); |
1099 |
compilationUnit.types().add(typeDeclaration); |