MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_literal_uint

Method parse_literal_uint

src/sql-parser/src/parser.rs:6978–6988  ·  view source on GitHub ↗

Parse an unsigned literal integer.

(&mut self)

Source from the content-addressed store, hash-verified

6976
6977 /// Parse an unsigned literal integer.
6978 fn parse_literal_uint(&mut self) -> Result<u64, ParserError> {
6979 match self.next_token() {
6980 Some(Token::Number(s)) => s.parse::<u64>().map_err(|e| {
6981 self.error(
6982 self.peek_prev_pos(),
6983 format!("Could not parse '{}' as u64: {}", s, e),
6984 )
6985 }),
6986 other => self.expected(self.peek_prev_pos(), "literal unsigned integer", other),
6987 }
6988 }
6989
6990 /// Parse a literal string
6991 fn parse_literal_string(&mut self) -> Result<String, ParserError> {

Callers 4

parse_formatMethod · 0.80
parse_versionMethod · 0.80

Calls 4

next_tokenMethod · 0.80
peek_prev_posMethod · 0.80
expectedMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected