use of com.google.javascript.jscomp.parsing.parser.trees.TypeQueryTree in project closure-compiler by google.
the class Parser method parseTypeQuery.
private ParseTree parseTypeQuery() {
SourcePosition start = getTreeStartLocation();
if (peek(TokenType.TYPEOF)) {
eat(TokenType.TYPEOF);
IdentifierToken token = eatId();
ImmutableList.Builder<String> identifiers = ImmutableList.builder();
if (token != null) {
identifiers.add(token.value);
}
while (peek(TokenType.PERIOD)) {
// TypeQueryExpression . IdentifierName
eat(TokenType.PERIOD);
token = eatId();
if (token == null) {
break;
}
identifiers.add(token.value);
}
return new TypeQueryTree(getTreeLocation(start), identifiers.build());
} else {
return parseTypeReference();
}
}
Aggregations