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

Function parseTestOr

src/utils/bash/bashParser.ts:3705–3731  ·  view source on GitHub ↗
(P: ParseState, closer: string)

Source from the content-addressed store, hash-verified

3703}
3704
3705function parseTestOr(P: ParseState, closer: string): TsNode | null {
3706 let left = parseTestAnd(P, closer)
3707 if (!left) return null
3708 while (true) {
3709 skipBlanks(P.L)
3710 const save = saveLex(P.L)
3711 if (peek(P.L) === '|' && peek(P.L, 1) === '|') {
3712 const s = P.L.b
3713 advance(P.L)
3714 advance(P.L)
3715 const op = mk(P, '||', s, P.L.b, [])
3716 const right = parseTestAnd(P, closer)
3717 if (!right) {
3718 restoreLex(P.L, save)
3719 break
3720 }
3721 left = mk(P, 'binary_expression', left.startIndex, right.endIndex, [
3722 left,
3723 op,
3724 right,
3725 ])
3726 } else {
3727 break
3728 }
3729 }
3730 return left
3731}
3732
3733function parseTestAnd(P: ParseState, closer: string): TsNode | null {
3734 let left = parseTestUnary(P, closer)

Callers 2

parseTestExprFunction · 0.85
parseTestUnaryFunction · 0.85

Calls 7

parseTestAndFunction · 0.85
skipBlanksFunction · 0.85
saveLexFunction · 0.85
advanceFunction · 0.85
mkFunction · 0.85
restoreLexFunction · 0.85
peekFunction · 0.70

Tested by

no test coverage detected