MCPcopy Index your code
hub / github.com/angular/angular / parsePrefix

Method parsePrefix

packages/compiler/src/expression_parser/parser.ts:1057–1088  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1055 }
1056
1057 private parsePrefix(): AST {
1058 if (this.next.type == TokenType.Operator) {
1059 const start = this.inputIndex;
1060 const operator = this.next.strValue;
1061 let result: AST;
1062 switch (operator) {
1063 case '+':
1064 this.advance();
1065 result = this.parsePrefix();
1066 return Unary.createPlus(this.span(start), this.sourceSpan(start), result);
1067 case '-':
1068 this.advance();
1069 result = this.parsePrefix();
1070 return Unary.createMinus(this.span(start), this.sourceSpan(start), result);
1071 case '!':
1072 this.advance();
1073 result = this.parsePrefix();
1074 return new PrefixNot(this.span(start), this.sourceSpan(start), result);
1075 }
1076 } else if (this.next.isKeywordTypeof()) {
1077 const start = this.inputIndex;
1078 this.advance();
1079 const result = this.parsePrefix();
1080 return new TypeofExpression(this.span(start), this.sourceSpan(start), result);
1081 } else if (this.next.isKeywordVoid()) {
1082 const start = this.inputIndex;
1083 this.advance();
1084 const result = this.parsePrefix();
1085 return new VoidExpression(this.span(start), this.sourceSpan(start), result);
1086 }
1087 return this.parseCallChain();
1088 }
1089
1090 private parseCallChain(): AST {
1091 const start = this.inputIndex;

Callers 1

parseExponentiationMethod · 0.95

Calls 8

advanceMethod · 0.95
spanMethod · 0.95
sourceSpanMethod · 0.95
parseCallChainMethod · 0.95
createPlusMethod · 0.80
createMinusMethod · 0.80
isKeywordTypeofMethod · 0.80
isKeywordVoidMethod · 0.80

Tested by

no test coverage detected