/** * If there is a parsing error causing a recovered module the source positions may be updated only partially. * See bug 518843 for a case where this issue occurred. This method provide a safety net with * source positions updated even in case of a recovery - if there is no recovery, the source positions will * be retained in-tact identical to the compile time ast module node. */ private int getKnownEnd(ModuleDeclaration md, int sourceEnd, int declSourceEnd) { int end = retrieveRightBrace(md.getStartPosition() + 1, this.compilationUnitSourceLength); end = end > sourceEnd ? end : sourceEnd; end = end > declSourceEnd ? end : declSourceEnd; return end; } public ModuleDeclaration convertToModuleDeclaration(org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration moduleDeclaration) {
/** * If there is a parsing error causing a recovered module the source positions may be updated only partially. * See bug 518843 for a case where this issue occurred. This method provide a safety net with * source positions updated even in case of a recovery - if there is no recovery, the source positions will * be retained in-tact identical to the compile time ast module node. */ private int getKnownEnd(ModuleDeclaration md, int sourceEnd, int declSourceEnd) { int end = retrieveRightBrace(md.getStartPosition() + 1, this.compilationUnitSourceLength); end = end > sourceEnd ? end : sourceEnd; end = end > declSourceEnd ? end : declSourceEnd; return end; } public ModuleDeclaration convertToModuleDeclaration(org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration moduleDeclaration) {
@SuppressWarnings("unchecked") @Override ASTNode clone0(AST target) { ModuleDeclaration result = new ModuleDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.setOpen(isOpen()); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); result.setName((SimpleName) getName().clone(target)); result.moduleStatements().addAll(ASTNode.copySubtrees(target, moduleStatements())); return result; }
@SuppressWarnings("unchecked") @Override ASTNode clone0(AST target) { ModuleDeclaration result = new ModuleDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc())); result.setOpen(isOpen()); result.annotations().addAll(ASTNode.copySubtrees(target, annotations())); result.setName((SimpleName) getName().clone(target)); result.moduleStatements().addAll(ASTNode.copySubtrees(target, moduleStatements())); return result; }
int startIndent= getIndent(node.getStartPosition()) + 1; boolean fakeInModule = this.tokenScanner.getScanner().fakeInModule; this.tokenScanner.getScanner().fakeInModule = true;
int startIndent= getIndent(node.getStartPosition()) + 1; boolean fakeInModule = this.tokenScanner.getScanner().fakeInModule; this.tokenScanner.getScanner().fakeInModule = true;