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

Function parseTestUnary

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

Source from the content-addressed store, hash-verified

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

Callers 1

parseTestAndFunction · 0.85

Calls 6

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

Tested by

no test coverage detected