MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / consumeKeyword

Function consumeKeyword

src/utils/bash/bashParser.ts:3684–3693  ·  view source on GitHub ↗
(P: ParseState, name: string, kids: TsNode[])

Source from the content-addressed store, hash-verified

3682}
3683
3684function consumeKeyword(P: ParseState, name: string, kids: TsNode[]): void {
3685 skipNewlines(P)
3686 const save = saveLex(P.L)
3687 const t = nextToken(P.L, 'cmd')
3688 if (t.type === 'WORD' && t.value === name) {
3689 kids.push(leaf(P, name, t))
3690 } else {
3691 restoreLex(P.L, save)
3692 }
3693}
3694
3695// ───────────────────── Test & Arithmetic Expressions ─────────────────────
3696

Callers 3

parseIfFunction · 0.85
parseDoGroupFunction · 0.85
parseCaseFunction · 0.85

Calls 6

skipNewlinesFunction · 0.85
saveLexFunction · 0.85
nextTokenFunction · 0.85
leafFunction · 0.85
restoreLexFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected