/* ----------------------------------------------------------------- */
public AbstractParser.NodeResult<Module> parseModule(String defaultModuleName, Path compilationUnitPath) {
assertNotNull(defaultModuleName);
DeclarationModule md = parseModuleDeclaration();
ArrayView<ASTNode> members = parseDeclarations(null, true);
assertTrue(lookAhead() == DeeTokens.EOF);
advanceSubChannelTokens(); // Ensure pending whitespace is consumed as well
assertTrue(getSourcePosition() == lookAheadElement().getStartPos());
//assertTrue(getSourcePosition() == getSource().length()); //This is not true if explicit EOF token is present
SourceRange modRange = new SourceRange(0, getSourcePosition());
if(md != null) {
return result(false, conclude(modRange,
new Module(md.getModuleSymbol(), md, members, compilationUnitPath)));
} else {
return result(false, conclude(modRange,
Module.createModuleNoModuleDecl(defaultModuleName, members, compilationUnitPath, modRange)));
}
}