MCPcopy Create free account
hub / github.com/prettier/prettier / parseComments

Function parseComments

src/language-graphql/parser-graphql.js:10–20  ·  view source on GitHub ↗

@import {ParseOptions} from "graphql"

(ast)

Source from the content-addressed store, hash-verified

8*/
9
10function parseComments(ast) {
11 const comments = [];
12 const { startToken, endToken } = ast.loc;
13 for (let token = startToken; token !== endToken; token = token.next) {
14 if (token.kind === "Comment") {
15 comments.push({ ...token, loc: { start: token.start, end: token.end } });
16 }
17 }
18
19 return comments;
20}
21
22/** @type {ParseOptions} */
23const parseOptions = {

Callers 1

parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected