MCPcopy Create free account
hub / github.com/babel/babel / parseTopicReference

Function parseTopicReference

packages/babel-parser/src/parser/expression.ts:1469–1481  ·  view source on GitHub ↗
(pipeProposal: string)

Source from the content-addressed store, hash-verified

1467 // its configuration might not match the current token’s type.
1468 // See <https://github.com/js-choi/proposal-hack-pipes>.
1469 parseTopicReference(pipeProposal: string): N.Expression {
1470 const node = this.startNode<N.TopicReference>();
1471 const startLoc = this.state.startLoc;
1472 const tokenType = this.state.type;
1473
1474 // Consume the current token.
1475 this.next();
1476
1477 // If the pipe-operator plugin’s configuration matches the current token’s type,
1478 // then this will return `node`, will have been finished as a topic reference.
1479 // Otherwise, this will throw a `PipeTopicUnconfiguredToken` error.
1480 return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);
1481 }
1482
1483 // This helper method attempts to finish the given `node`
1484 // into a topic-reference node for the given `pipeProposal`.

Callers

nothing calls this directly

Calls 1

nextMethod · 0.80

Tested by

no test coverage detected