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

Method parse_comparison

crates/hll-to-ir/src/parser.rs:811–837  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

809 self.expect_lbrace()?;
810 self.consume_terminators(); // skip the newline after `{`
811
812 let mut lines = Vec::new();
813
814 while !self.check_rbrace() && !self.is_eof() {
815 if matches!(self.peek(), Some(Token::StatementTerminator)) {
816 let source = Self::normalize_asm_line(&self.spans[self.pos].source_line);
817 self.advance();
818 if !source.is_empty() {
819 lines.push(source);
820 }
821 } else {
822 self.advance();
823 }
824 }
825
826 // The loop does not capture a one-line block before reaching `}`.
827 if !self.is_eof() {
828 let source = Self::normalize_asm_line(&self.spans[self.pos].source_line);
829 if !source.is_empty() {
830 lines.push(source);
831 }
832 }
833
834 self.expect_rbrace()?;
835 Ok(Statement::AsmBlock {
836 ops: self.parse_asm_ops(lines)?,
837 })
838 }
839
840 // Strip the wrapper carried by opening and one-line asm source lines.

Callers 1

parse_equalityMethod · 0.80

Calls 7

parse_shiftMethod · 0.80
consume_terminatorsMethod · 0.80
match_ltMethod · 0.80
match_lteMethod · 0.80
match_gtMethod · 0.80
match_gteMethod · 0.80
parse_additiveMethod · 0.80

Tested by

no test coverage detected