List<ModuleItem> items = new ArrayList<ModuleItem>();
for (ParseNode node : nodes) {
if ((node instanceof ParseNodeComment) || (node instanceof ParseNodeExpression)) {
boolean isComments = (node instanceof ParseNodeComment);
items.add(new ModuleItem(node.getItem().getExpression(), isComments, node.getItem().getLineNum(), node.getItem().getStartChar(), node.getItem().getEndChar()));
}
}
return new Module(moduleName, resourceName, uses, imports, items, buffer);
}