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

Method parseVariableValue

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

Source from the content-addressed store, hash-verified

392 }
393
394 private parseVariableValue(): LiteralValue {
395 const token = this.peek();
396
397 switch (token.type) {
398 case TokenType.STRING:
399 return this.parseStringLiteral();
400 case TokenType.NUMBER:
401 return this.parseNumberLiteral();
402 case TokenType.IDENTIFIER:
403 return this.parseIdentifierLiteral();
404 case TokenType.LEFT_PAREN:
405 return this.parseTupleLiteral();
406 default:
407 throw new ParserError(
408 `Invalid variable value: ${token.value}. Variables can only contain literal values (strings, numbers, identifiers, or tuples)`,
409 token.position
410 );
411 }
412 }
413
414 private parseElement(): ElementNode {
415 const nameToken = this.consume(

Callers 1

Calls 5

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

Tested by

no test coverage detected