parseUInt32 parses a string and returns a 32-bit unsigned integer literal.
()
| 69 | |
| 70 | // parseUInt32 parses a string and returns a 32-bit unsigned integer literal. |
| 71 | func (p *Parser) parseUInt32() (uint32, error) { |
| 72 | tok, pos, lit := p.scanIgnoreWhitespace() |
| 73 | if tok != NUMBER { |
| 74 | return 0, newParseError(tokstr(tok, lit), []string{"number"}, pos) |
| 75 | } |
| 76 | |
| 77 | // Convert string to unsigned 32-bit integer |
| 78 | n, err := strconv.ParseUint(lit, 10, 32) |
| 79 | if err != nil { |
| 80 | return 0, &ParseError{Message: err.Error(), Pos: pos} |
| 81 | } |
| 82 | |
| 83 | return uint32(n), nil |
| 84 | } |
| 85 | |
| 86 | // parseUInt64 parses a string and returns a 64-bit unsigned integer literal. |
| 87 | func (p *Parser) parseUInt64() (uint64, error) { |
nothing calls this directly
no test coverage detected