use of com.google.javascript.jscomp.parsing.parser.trees.NamespaceDeclarationTree in project closure-compiler by google.
the class Parser method parseNamespaceDeclaration.
private NamespaceDeclarationTree parseNamespaceDeclaration(boolean isAmbient) {
SourcePosition start = getTreeStartLocation();
if (eatOpt(TokenType.MODULE) == null) {
// Accept "module" or "namespace"
eat(TokenType.NAMESPACE);
}
NamespaceNameTree name = parseNamespaceName();
eat(TokenType.OPEN_CURLY);
ImmutableList<ParseTree> elements = isAmbient ? parseAmbientNamespaceElements() : parseNamespaceElements();
eat(TokenType.CLOSE_CURLY);
return new NamespaceDeclarationTree(getTreeLocation(start), name, elements);
}
Aggregations