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

Method parseTupleItem

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

Source from the content-addressed store, hash-verified

802 }
803
804 private parseTupleItem(): LiteralValue {
805 const fall = this.fallThrough();
806 if (fall) {
807 return fall;
808 }
809 const token = this.peek();
810 switch (token.type) {
811 case TokenType.STRING:
812 return this.parseStringLiteral();
813 case TokenType.NUMBER:
814 return this.parseNumberLiteral();
815 case TokenType.IDENTIFIER:
816 return this.parseIdentifierLiteral();
817 case TokenType.DOLLAR:
818 return this.parseVariableReference();
819 default:
820 throw new ParserError(
821 `Invalid value inside tuple: ${token.type}`,
822 token.position
823 );
824 }
825 }
826
827 private parseStringLiteral(): StringLiteral {
828 const token = this.consume(TokenType.STRING, "Expected string literal");

Callers 1

parseTupleLiteralMethod · 0.95

Calls 6

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

Tested by

no test coverage detected