()
| 1088 | } |
| 1089 | |
| 1090 | private parseCallChain(): AST { |
| 1091 | const start = this.inputIndex; |
| 1092 | let result = this.parsePrimary(); |
| 1093 | while (true) { |
| 1094 | if (this.consumeOptionalCharacter(chars.$PERIOD)) { |
| 1095 | result = this.parseAccessMember(result, start, false); |
| 1096 | } else if (this.consumeOptionalOperator('?.')) { |
| 1097 | if (this.consumeOptionalCharacter(chars.$LPAREN)) { |
| 1098 | result = this.parseCall(result, start, true); |
| 1099 | } else { |
| 1100 | result = this.consumeOptionalCharacter(chars.$LBRACKET) |
| 1101 | ? this.parseKeyedReadOrWrite(result, start, true) |
| 1102 | : this.parseAccessMember(result, start, true); |
| 1103 | } |
| 1104 | } else if (this.consumeOptionalCharacter(chars.$LBRACKET)) { |
| 1105 | result = this.parseKeyedReadOrWrite(result, start, false); |
| 1106 | } else if (this.consumeOptionalCharacter(chars.$LPAREN)) { |
| 1107 | result = this.parseCall(result, start, false); |
| 1108 | } else if (this.consumeOptionalOperator('!')) { |
| 1109 | result = new NonNullAssert(this.span(start), this.sourceSpan(start), result); |
| 1110 | } else if (this.next.isTemplateLiteralEnd()) { |
| 1111 | result = this.parseNoInterpolationTaggedTemplateLiteral(result, start); |
| 1112 | } else if (this.next.isTemplateLiteralPart()) { |
| 1113 | result = this.parseTaggedTemplateLiteral(result, start); |
| 1114 | } else { |
| 1115 | return result; |
| 1116 | } |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | private parsePrimary(): AST { |
| 1121 | const start = this.inputIndex; |
no test coverage detected