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

Function lex_string

src/sql-lexer/src/lexer.rs:263–279  ·  view source on GitHub ↗
(buf: &mut LexBuf)

Source from the content-addressed store, hash-verified

261}
262
263fn lex_string(buf: &mut LexBuf) -> Result<String, LexerError> {
264 let mut s = String::new();
265 loop {
266 let pos = buf.pos() - 1;
267 loop {
268 match buf.next() {
269 Some('\'') if buf.consume('\'') => s.push('\''),
270 Some('\'') => break,
271 Some(c) => s.push(c),
272 None => bail!(pos, "unterminated quoted string"),
273 }
274 }
275 if !lex_to_adjacent_string(buf) {
276 return Ok(s);
277 }
278 }
279}
280
281fn lex_extended_string(buf: &mut LexBuf) -> Result<Token, LexerError> {
282 fn lex_unicode_escape(buf: &mut LexBuf, n: usize) -> Result<char, LexerError> {

Callers 1

lexFunction · 0.85

Calls 5

lex_to_adjacent_stringFunction · 0.85
posMethod · 0.80
nextMethod · 0.45
consumeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected