MCPcopy Index your code
hub / github.com/uber/aresdb / parseUInt64

Method parseUInt64

query/expr/parser.go:87–100  ·  view source on GitHub ↗

parseUInt64 parses a string and returns a 64-bit unsigned integer literal.

()

Source from the content-addressed store, hash-verified

85
86// parseUInt64 parses a string and returns a 64-bit unsigned integer literal.
87func (p *Parser) parseUInt64() (uint64, error) {
88 tok, pos, lit := p.scanIgnoreWhitespace()
89 if tok != NUMBER {
90 return 0, newParseError(tokstr(tok, lit), []string{"number"}, pos)
91 }
92
93 // Convert string to unsigned 64-bit integer
94 n, err := strconv.ParseUint(lit, 10, 64)
95 if err != nil {
96 return 0, &ParseError{Message: err.Error(), Pos: pos}
97 }
98
99 return uint64(n), nil
100}
101
102// parseIdent parses an identifier.
103func (p *Parser) parseIdent() (string, error) {

Callers

nothing calls this directly

Calls 4

scanIgnoreWhitespaceMethod · 0.95
newParseErrorFunction · 0.85
tokstrFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected