use of com.google.javascript.jscomp.parsing.parser.trees.NamespaceNameTree 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);
}
use of com.google.javascript.jscomp.parsing.parser.trees.NamespaceNameTree in project closure-compiler by google.
the class Parser method parseNamespaceName.
private NamespaceNameTree parseNamespaceName() {
SourcePosition start = getTreeStartLocation();
IdentifierToken token = eatId();
return new NamespaceNameTree(getTreeLocation(start), buildIdentifierPath(token));
}
Aggregations