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

Function parseDoGroup

source code/utils/bash/bashParser.ts:3308–3322  ·  view source on GitHub ↗
(P: ParseState)

Source from the content-addressed store, hash-verified

3306}
3307
3308function parseDoGroup(P: ParseState): TsNode | null {
3309 skipNewlines(P)
3310 const save = saveLex(P.L)
3311 const doTok = nextToken(P.L, 'cmd')
3312 if (doTok.type !== 'WORD' || doTok.value !== 'do') {
3313 restoreLex(P.L, save)
3314 return null
3315 }
3316 const doKw = leaf(P, 'do', doTok)
3317 const body = parseStatements(P, null)
3318 const kids: TsNode[] = [doKw, ...body]
3319 consumeKeyword(P, 'done', kids)
3320 const last = kids[kids.length - 1]!
3321 return mk(P, 'do_group', doKw.startIndex, last.endIndex, kids)
3322}
3323
3324function parseCase(P: ParseState, caseTok: Token): TsNode {
3325 const caseKw = leaf(P, 'case', caseTok)

Callers 2

parseWhileFunction · 0.85
parseForFunction · 0.85

Calls 8

skipNewlinesFunction · 0.85
saveLexFunction · 0.85
nextTokenFunction · 0.85
restoreLexFunction · 0.85
leafFunction · 0.85
parseStatementsFunction · 0.85
consumeKeywordFunction · 0.85
mkFunction · 0.85

Tested by

no test coverage detected