MCPcopy Create free account
hub / github.com/MirrowApp/mirrow / parseAttributeValue

Method parseAttributeValue

packages/core/src/compiler/parser.ts:738–763  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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(

Callers 1

parseAttributeEntryMethod · 0.95

Calls 7

fallThroughMethod · 0.95
peekMethod · 0.95
parseStringLiteralMethod · 0.95
parseNumberLiteralMethod · 0.95
parseTupleLiteralMethod · 0.95

Tested by

no test coverage detected