MCPcopy Index your code
hub / github.com/codeaashu/claude-code / parseSource

Function parseSource

src/utils/bash/bashParser.ts:610–631  ·  view source on GitHub ↗
(source: string, timeoutMs?: number)

Source from the content-addressed store, hash-verified

608}
609
610function parseSource(source: string, timeoutMs?: number): TsNode | null {
611 const L = makeLexer(source)
612 const srcBytes = byteLengthUtf8(source)
613 const P: ParseState = {
614 L,
615 src: source,
616 srcBytes,
617 isAscii: srcBytes === source.length,
618 nodeCount: 0,
619 deadline: performance.now() + (timeoutMs ?? PARSE_TIMEOUT_MS),
620 aborted: false,
621 inBacktick: 0,
622 stopToken: null,
623 }
624 try {
625 const program = parseProgram(P)
626 if (P.aborted) return null
627 return program
628 } catch {
629 return null
630 }
631}
632
633function byteLengthUtf8(s: string): number {
634 let b = 0

Callers

nothing calls this directly

Calls 3

makeLexerFunction · 0.85
byteLengthUtf8Function · 0.85
parseProgramFunction · 0.85

Tested by

no test coverage detected