use of com.google.javascript.jscomp.parsing.parser.util.SourcePosition in project closure-compiler by google.
the class Parser method parseEnumDeclaration.
private ParseTree parseEnumDeclaration() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.ENUM);
IdentifierToken name = eatId();
eat(TokenType.OPEN_CURLY);
ImmutableList<ParseTree> members = parseEnumMembers();
eat(TokenType.CLOSE_CURLY);
return new EnumDeclarationTree(getTreeLocation(start), name, members);
}
use of com.google.javascript.jscomp.parsing.parser.util.SourcePosition 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.util.SourcePosition 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.util.SourcePosition 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.util.SourcePosition 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