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

Method parse_raw_ident_str

src/sql-parser/src/parser.rs:4370–4382  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

4368 }
4369
4370 fn parse_raw_ident_str(&mut self) -> Result<String, ParserError> {
4371 let id = match self.next_token() {
4372 Some(Token::Ident(id)) => id.into_inner(),
4373 Some(Token::Number(n)) => n,
4374 _ => return parser_err!(self, self.peek_prev_pos(), "expected id"),
4375 };
4376 // A resolved name renders as `[id]`; an empty id (e.g. `[""]`) would
4377 // display as `[]` and fail to reparse. Reject it.
4378 if id.is_empty() {
4379 return parser_err!(self, self.peek_prev_pos(), "expected id");
4380 }
4381 Ok(id)
4382 }
4383
4384 fn parse_optional_in_cluster(&mut self) -> Result<Option<RawClusterName>, ParserError> {
4385 if self.parse_keywords(&[IN, CLUSTER]) {

Callers 2

parse_raw_identMethod · 0.80

Calls 3

next_tokenMethod · 0.80
into_innerMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected