()
| 736 | } |
| 737 | |
| 738 | private parseAttributeValue(): LiteralValue { |
| 739 | const fall = this.fallThrough(); |
| 740 | if (fall) { |
| 741 | this.fellThrough = true; |
| 742 | return fall; |
| 743 | } |
| 744 | const token = this.peek(); |
| 745 | |
| 746 | switch (token.type) { |
| 747 | case TokenType.STRING: |
| 748 | return this.parseStringLiteral(); |
| 749 | case TokenType.NUMBER: |
| 750 | return this.parseNumberLiteral(); |
| 751 | case TokenType.IDENTIFIER: |
| 752 | return this.parseIdentifierLiteral(); |
| 753 | case TokenType.LEFT_PAREN: |
| 754 | return this.parseTupleLiteral(); |
| 755 | case TokenType.DOLLAR: |
| 756 | return this.parseVariableReference(); |
| 757 | default: |
| 758 | throw new ParserError( |
| 759 | `Unexpected token '${token.value}' in attribute value`, |
| 760 | token.position |
| 761 | ); |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | private parseTupleLiteral(): TupleLiteral { |
| 766 | const start = this.consume( |
no test coverage detected