MCPcopy Index your code
hub / github.com/endbasic/endbasic / apply1

Method apply1

core/src/parser.rs:206–217  ·  view source on GitHub ↗
(
            exprs: &mut Vec<Expr>,
            pos: LineCol,
            f: fn(Box<UnaryOpSpan>) -> Expr,
        )

Source from the content-addressed store, hash-verified

204 /// Pops operands from the `expr` stack, applies this operation, and pushes the result back.
205 fn apply(&self, exprs: &mut Vec<Expr>) -> Result<()> {
206 fn apply1(
207 exprs: &mut Vec<Expr>,
208 pos: LineCol,
209 f: fn(Box<UnaryOpSpan>) -> Expr,
210 ) -> Result<()> {
211 if exprs.is_empty() {
212 return Err(Error::Bad(pos, "Not enough values to apply operator".to_owned()));
213 }
214 let expr = exprs.pop().unwrap();
215 exprs.push(f(Box::from(UnaryOpSpan { expr, pos })));
216 Ok(())
217 }
218
219 fn apply2(
220 exprs: &mut Vec<Expr>,

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected