MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / receiver_call_or_macro

Method receiver_call_or_macro

cel/src/parser/parser.rs:167–194  ·  view source on GitHub ↗
(
        &mut self,
        id: u64,
        func_name: String,
        target: IdedExpr,
        args: Vec<IdedExpr>,
    )

Source from the content-addressed store, hash-verified

165 }
166
167 fn receiver_call_or_macro(
168 &mut self,
169 id: u64,
170 func_name: String,
171 target: IdedExpr,
172 args: Vec<IdedExpr>,
173 ) -> IdedExpr {
174 match macros::find_expander(&func_name, Some(&target), &args) {
175 None => IdedExpr {
176 id,
177 expr: Expr::Call(CallExpr {
178 target: Some(Box::new(target)),
179 func_name,
180 args,
181 }),
182 },
183 Some(expander) => {
184 let mut helper = MacroExprHelper {
185 helper: &mut self.helper,
186 id,
187 };
188 match expander(&mut helper, Some(target), args) {
189 Ok(expr) => expr,
190 Err(err) => self.report_parse_error(None, err),
191 }
192 }
193 }
194 }
195
196 pub fn parse(mut self, source: &str) -> Result<IdedExpr, ParseErrors> {
197 let parse_errors = Rc::new(RefCell::new(Vec::<ParseError>::new()));

Callers 1

visit_MemberCallMethod · 0.80

Calls 2

find_expanderFunction · 0.85
report_parse_errorMethod · 0.80

Tested by

no test coverage detected