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

Function parseArithCommaList

source code/utils/bash/bashParser.ts:4140–4157  ·  view source on GitHub ↗

Top-level: comma-separated list. arithmetic_expansion emits multiple children.

(
  P: ParseState,
  stop: string,
  mode: ArithMode = 'var',
)

Source from the content-addressed store, hash-verified

4138
4139/** Top-level: comma-separated list. arithmetic_expansion emits multiple children. */
4140function parseArithCommaList(
4141 P: ParseState,
4142 stop: string,
4143 mode: ArithMode = 'var',
4144): TsNode[] {
4145 const out: TsNode[] = []
4146 while (true) {
4147 const e = parseArithTernary(P, stop, mode)
4148 if (e) out.push(e)
4149 skipBlanks(P.L)
4150 if (peek(P.L) === ',' && !isArithStop(P, stop)) {
4151 advance(P.L)
4152 continue
4153 }
4154 break
4155 }
4156 return out
4157}
4158
4159function parseArithTernary(
4160 P: ParseState,

Callers 4

parseCommandFunction · 0.85
parseDollarLikeFunction · 0.85
parseForFunction · 0.85
parseArithPrimaryFunction · 0.85

Calls 5

parseArithTernaryFunction · 0.85
skipBlanksFunction · 0.85
isArithStopFunction · 0.85
advanceFunction · 0.85
peekFunction · 0.70

Tested by

no test coverage detected