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

Function advance

src/utils/bash/bashParser.ts:146–160  ·  view source on GitHub ↗

Advance one JS char, updating byte offset for UTF-8.

(L: Lexer)

Source from the content-addressed store, hash-verified

144
145/** Advance one JS char, updating byte offset for UTF-8. */
146function advance(L: Lexer): void {
147 const c = L.src.charCodeAt(L.i)
148 L.i++
149 if (c < 0x80) {
150 L.b++
151 } else if (c < 0x800) {
152 L.b += 2
153 } else if (c >= 0xd800 && c <= 0xdbff) {
154 // High surrogate — next char completes the pair, total 4 UTF-8 bytes
155 L.b += 4
156 L.i++
157 } else {
158 L.b += 3
159 }
160}
161
162function peek(L: Lexer, off = 0): string {
163 return L.i + off < L.len ? L.src[L.i + off]! : ''

Callers 15

nextVimWordMethod · 0.85
endOfVimWordMethod · 0.85
skipBlanksFunction · 0.85
nextTokenFunction · 0.85
tryParseAssignmentFunction · 0.85
tryParseRedirectFunction · 0.85
parseProcessSubFunction · 0.85
scanHeredocBodiesFunction · 0.85
parseHeredocBodyContentFunction · 0.85
parseWordFunction · 0.85
parseBareWordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected