MCPcopy Create free account
hub / github.com/Glyphack/enderpy / parse_with_items

Method parse_with_items

parser/src/parser/parser.rs:477–494  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

475 }
476
477 fn parse_with_items(&mut self) -> Result<Vec<WithItem>, ParsingError> {
478 let mut items = vec![];
479
480 if self.eat(Kind::LeftParen) {
481 items.push(self.parse_with_item()?);
482 while self.eat(Kind::Comma) & !self.at(Kind::RightParen) {
483 items.push(self.parse_with_item()?);
484 }
485 self.expect(Kind::RightParen)?;
486 return Ok(items);
487 }
488 items.push(self.parse_with_item()?);
489 while self.eat(Kind::Comma) & !self.at(Kind::Colon) {
490 items.push(self.parse_with_item()?);
491 }
492
493 Ok(items)
494 }
495
496 fn parse_with_item(&mut self) -> Result<WithItem, ParsingError> {
497 let node = self.start_node();

Callers 1

parse_with_statementMethod · 0.80

Calls 4

eatMethod · 0.80
parse_with_itemMethod · 0.80
atMethod · 0.80
expectMethod · 0.80

Tested by

no test coverage detected