MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / parseSource

Function parseSource

source code/utils/bash/bashParser.ts:612–633  ·  view source on GitHub ↗
(source: string, timeoutMs?: number)

Source from the content-addressed store, hash-verified

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