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

Method error_with_token

crates/hll-to-ir/src/parser.rs:2327–2332  ·  view source on GitHub ↗
(&self, message: &str, token: &Token<'a>)

Source from the content-addressed store, hash-verified

2325 fn match_lparen(&mut self) -> bool {
2326 self.match_variant(|t| matches!(t, Token::LParen))
2327 }
2328
2329 fn parse_primary(&mut self) -> Result<Expression, ParserError> {
2330 let expr = match self.peek() {
2331 Some(Token::Fn) => {
2332 return Err(self.error(
2333 "lambda expressions omit `fn`; write `(name: Type) -> Return { ... }`",
2334 ));
2335 }

Callers 9

parse_declarationMethod · 0.80
parse_type_atomMethod · 0.80
parse_usize_literalMethod · 0.80
expect_identMethod · 0.80
expect_integerMethod · 0.80
expect_hex_integerMethod · 0.80
expect_floatMethod · 0.80
parse_primaryMethod · 0.80
expect_string_literalMethod · 0.80

Calls 1

current_spanMethod · 0.80

Tested by

no test coverage detected