use of com.google.javascript.jscomp.parsing.parser.trees.ParseTree in project closure-compiler by google.
the class Parser method parseEnumMembers.
private ImmutableList<ParseTree> parseEnumMembers() {
SourceRange range = getTreeLocation(getTreeStartLocation());
IdentifierToken propertyName;
ParseTree member = null;
ImmutableList.Builder<ParseTree> result = ImmutableList.builder();
while (peekId()) {
propertyName = parseIdentifierExpression().identifierToken;
member = new PropertyNameAssignmentTree(range, propertyName, null);
result.add(member);
if (!peek(TokenType.CLOSE_CURLY)) {
eat(TokenType.COMMA);
}
}
return result.build();
}
use of com.google.javascript.jscomp.parsing.parser.trees.ParseTree in project closure-compiler by google.
the class Parser method parseAmbientDeclaration.
private ParseTree parseAmbientDeclaration() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.DECLARE);
ParseTree declare = parseAmbientDeclarationHelper();
return new AmbientDeclarationTree(getTreeLocation(start), declare);
}
use of com.google.javascript.jscomp.parsing.parser.trees.ParseTree in project closure-compiler by google.
the class Parser method parseTypeAlias.
private ParseTree parseTypeAlias() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.TYPE);
IdentifierToken alias = eatId();
eat(TokenType.EQUAL);
ParseTree original = parseType();
eatPossibleImplicitSemiColon();
return new TypeAliasTree(getTreeLocation(start), alias, original);
}
use of com.google.javascript.jscomp.parsing.parser.trees.ParseTree in project closure-compiler by google.
the class Parser method parsePatternRest.
private ParseTree parsePatternRest(PatternKind patternKind) {
SourcePosition start = getTreeStartLocation();
eat(TokenType.SPREAD);
ParseTree patternAssignmentTarget = parseRestAssignmentTarget(patternKind);
return new AssignmentRestElementTree(getTreeLocation(start), patternAssignmentTarget);
}
use of com.google.javascript.jscomp.parsing.parser.trees.ParseTree in project closure-compiler by google.
the class Parser method parseRecordTypeExpression.
private ParseTree parseRecordTypeExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree typeExpression;
if (peek(TokenType.OPEN_CURLY)) {
eat(TokenType.OPEN_CURLY);
typeExpression = new RecordTypeTree(getTreeLocation(start), parseInterfaceElements());
eat(TokenType.CLOSE_CURLY);
} else {
typeExpression = parseTypeQuery();
}
return typeExpression;
}
Aggregations