MCPcopy Create free account
hub / github.com/microsoft/typescript-go / charAt

Method charAt

internal/scanner/scanner.go:434–439  ·  view source on GitHub ↗

NOTE: this returns a rune, but only decodes the byte at the offset.

(offset int)

Source from the content-addressed store, hash-verified

432
433// NOTE: this returns a rune, but only decodes the byte at the offset.
434func (s *Scanner) charAt(offset int) rune {
435 if s.pos+offset < s.end {
436 return rune(s.text[s.pos+offset])
437 }
438 return -1
439}
440
441func (s *Scanner) charAndSize() (rune, int) {
442 // Fast path: a single ASCII byte. The vast majority of source bytes are

Callers 7

ScanMethod · 0.95
ScanJsxTokenExMethod · 0.95
scanEscapeSequenceMethod · 0.95
peekUnicodeEscapeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected