MCPcopy Index your code
hub / github.com/BishopFox/jsluice / Next

Method Next

strings.go:86–95  ·  view source on GitHub ↗

Next returns the next rune in the input string, moving the position pointer on by the size of the rune that was decoded. For ASCII text this wouldn't be required, but in JavaScript source we will encounter many runes that have a length of more than one byte

()

Source from the content-addressed store, hash-verified

84// source we will encounter many runes that have a length of more
85// than one byte
86func (s *stringLexer) Next() rune {
87 if s.pos >= len(s.str) {
88 s.done = true
89 return -1
90 }
91
92 r, l := utf8.DecodeRuneInString(s.str[s.pos:])
93 s.pos += l
94 return r
95}
96
97// Backup moves the position pointer back by the length of the
98// previous rune in the input string.

Callers 5

PeekMethod · 0.95
AcceptMethod · 0.95
AcceptUntilMethod · 0.95
AcceptRunMethod · 0.95
DecodeStringFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected