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

Function parseTestUnary

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

Source from the content-addressed store, hash-verified

3751}
3752
3753function parseTestUnary(P: ParseState, closer: string): TsNode | null {
3754 skipBlanks(P.L)
3755 const c = peek(P.L)
3756 if (c === '(') {
3757 const s = P.L.b
3758 advance(P.L)
3759 const open = mk(P, '(', s, P.L.b, [])
3760 const inner = parseTestOr(P, closer)
3761 skipBlanks(P.L)
3762 let close: TsNode
3763 if (peek(P.L) === ')') {
3764 const cs = P.L.b
3765 advance(P.L)
3766 close = mk(P, ')', cs, P.L.b, [])
3767 } else {
3768 close = mk(P, ')', P.L.b, P.L.b, [])
3769 }
3770 const kids = inner ? [open, inner, close] : [open, close]
3771 return mk(
3772 P,
3773 'parenthesized_expression',
3774 open.startIndex,
3775 close.endIndex,
3776 kids,
3777 )
3778 }
3779 return parseTestBinary(P, closer)
3780}
3781
3782/**
3783 * Parse `!`-negated or test-operator (`-f`) or parenthesized primary — but NOT

Callers 1

parseTestAndFunction · 0.85

Calls 6

skipBlanksFunction · 0.85
advanceFunction · 0.85
parseTestOrFunction · 0.85
parseTestBinaryFunction · 0.85
peekFunction · 0.70
mkFunction · 0.70

Tested by

no test coverage detected