use of com.google.javascript.jscomp.parsing.parser.trees.ImportSpecifierTree in project closure-compiler by google.
the class Parser method parseImportSpecifier.
// ImportSpecifier ::= Identifier ('as' Identifier)?
private ParseTree parseImportSpecifier() {
SourcePosition start = getTreeStartLocation();
IdentifierToken importedName = eatIdOrKeywordAsId();
IdentifierToken destinationName = null;
if (peekPredefinedString(PredefinedName.AS)) {
eatPredefinedString(PredefinedName.AS);
destinationName = eatId();
} else if (isKeyword(importedName.value)) {
reportExpectedError(null, PredefinedName.AS);
}
return new ImportSpecifierTree(getTreeLocation(start), importedName, destinationName);
}
Aggregations