MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / parses_pointer_cast_syntax

Function parses_pointer_cast_syntax

crates/hll-to-ir/src/parser.rs:2573–2598  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2571 ) -> Result<Vec<FormatSegment>, ParserError> {
2572 let content = &raw[1..raw.len() - 1];
2573 let error_at = |offset: usize, len: u32, message: &str| ParserError {
2574 message: message.to_owned(),
2575 span: Span {
2576 line: span.line,
2577 col: span.col + 1 + offset as u32,
2578 len,
2579 source_line: span.source_line.clone(),
2580 },
2581 };
2582 let bytes = content.as_bytes();
2583 let mut segments = Vec::new();
2584 let mut literal = String::new();
2585 let mut piece_start = 0usize;
2586 let mut i = 0usize;
2587 while i < bytes.len() {
2588 match bytes[i] {
2589 b'\\' => i += 2,
2590 b'{' if bytes.get(i + 1) == Some(&b'{') => {
2591 literal.push_str(&self.process_string_escapes(&content[piece_start..i]));
2592 literal.push('{');
2593 i += 2;
2594 piece_start = i;
2595 }
2596 b'}' if bytes.get(i + 1) == Some(&b'}') => {
2597 literal.push_str(&self.process_string_escapes(&content[piece_start..i]));
2598 literal.push('}');
2599 i += 2;
2600 piece_start = i;
2601 }

Callers

nothing calls this directly

Calls 1

parse_expressionMethod · 0.80

Tested by

no test coverage detected