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

Function parseTestOr

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

Source from the content-addressed store, hash-verified

3699}
3700
3701function parseTestOr(P: ParseState, closer: string): TsNode | null {
3702 let left = parseTestAnd(P, closer)
3703 if (!left) return null
3704 while (true) {
3705 skipBlanks(P.L)
3706 const save = saveLex(P.L)
3707 if (peek(P.L) === '|' && peek(P.L, 1) === '|') {
3708 const s = P.L.b
3709 advance(P.L)
3710 advance(P.L)
3711 const op = mk(P, '||', s, P.L.b, [])
3712 const right = parseTestAnd(P, closer)
3713 if (!right) {
3714 restoreLex(P.L, save)
3715 break
3716 }
3717 left = mk(P, 'binary_expression', left.startIndex, right.endIndex, [
3718 left,
3719 op,
3720 right,
3721 ])
3722 } else {
3723 break
3724 }
3725 }
3726 return left
3727}
3728
3729function parseTestAnd(P: ParseState, closer: string): TsNode | null {
3730 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
restoreLexFunction · 0.85
peekFunction · 0.70
mkFunction · 0.70

Tested by

no test coverage detected