MCPcopy Create free account
hub / github.com/PerroEngine/Perro / parse_expr

Method parse_expr

perro_source/core/perro_particle_math/src/lib.rs:416–431  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

414
415 fn parse_unary(&mut self) -> Result<(), CompileError> {
416 self.skip_ws();
417 if self.eat(b'+') {
418 return self.parse_unary();
419 }
420 if self.eat(b'-') {
421 self.parse_unary()?;
422 self.ops.push(Op::Neg);
423 return Ok(());
424 }
425 self.parse_primary()
426 }
427
428 fn parse_primary(&mut self) -> Result<(), CompileError> {
429 self.skip_ws();
430 if self.eat(b'(') {
431 self.parse_expr()?;
432 self.skip_ws();
433 self.expect(b')')?;
434 return Ok(());

Callers 3

compile_expressionFunction · 0.80
parse_primaryMethod · 0.80
parse_argsMethod · 0.80

Calls 4

parse_termMethod · 0.80
eatMethod · 0.80
skip_wsMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected