MCPcopy
hub / github.com/uber/aresdb / scanString

Method scanString

query/expr/scanner.go:207–220  ·  view source on GitHub ↗

scanString consumes a contiguous string of non-quote characters. Quote characters can be consumed if they're first escaped with a backslash.

()

Source from the content-addressed store, hash-verified

205// scanString consumes a contiguous string of non-quote characters.
206// Quote characters can be consumed if they're first escaped with a backslash.
207func (s *Scanner) scanString() (tok Token, pos Pos, lit string) {
208 s.r.unread()
209 _, pos = s.r.curr()
210
211 var err error
212 lit, err = ScanString(s.r)
213 if err == errBadString {
214 return BADSTRING, pos, lit
215 } else if err == errBadEscape {
216 _, pos = s.r.curr()
217 return BADESCAPE, pos, lit
218 }
219 return STRING, pos, lit
220}
221
222// scanNumber consumes anything that looks like the start of a number.
223// Numbers start with a digit, full stop, plus sign or minus sign.

Callers 2

scanMethod · 0.95
scanIdentMethod · 0.95

Calls 3

ScanStringFunction · 0.85
unreadMethod · 0.80
currMethod · 0.45

Tested by

no test coverage detected