MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / parseTestUnary

Function parseTestUnary

source code/utils/bash/bashParser.ts:3759–3786  ·  view source on GitHub ↗
(P: ParseState, closer: string)

Source from the content-addressed store, hash-verified

3757}
3758
3759function parseTestUnary(P: ParseState, closer: string): TsNode | null {
3760 skipBlanks(P.L)
3761 const c = peek(P.L)
3762 if (c === '(') {
3763 const s = P.L.b
3764 advance(P.L)
3765 const open = mk(P, '(', s, P.L.b, [])
3766 const inner = parseTestOr(P, closer)
3767 skipBlanks(P.L)
3768 let close: TsNode
3769 if (peek(P.L) === ')') {
3770 const cs = P.L.b
3771 advance(P.L)
3772 close = mk(P, ')', cs, P.L.b, [])
3773 } else {
3774 close = mk(P, ')', P.L.b, P.L.b, [])
3775 }
3776 const kids = inner ? [open, inner, close] : [open, close]
3777 return mk(
3778 P,
3779 'parenthesized_expression',
3780 open.startIndex,
3781 close.endIndex,
3782 kids,
3783 )
3784 }
3785 return parseTestBinary(P, closer)
3786}
3787
3788/**
3789 * 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