protospec-build 0.3.0

One binary format language to rule them all, One binary format language to find them, One binary format language to bring them all and in the darkness bind them.
Documentation
use super::*;

impl Scope {
    pub(super) fn convert_call_expression(
        self_: &Arc<RefCell<Scope>>,
        expr: &ast::CallExpression,
        _expected_type: PartialType,
    ) -> AsgResult<CallExpression> {
        let scope = self_.borrow();

        let function = scope
            .program
            .borrow()
            .functions
            .get(&*expr.function.name)
            .ok_or_else(|| {
                AsgError::UnresolvedFunction(expr.function.name.clone(), expr.function.span)
            })?
            .clone();

        let arguments = Self::convert_ffi_arguments(
            self_,
            &*function.name,
            expr.span,
            &expr.arguments[..],
            &function.arguments[..],
        )?;

        Ok(CallExpression {
            function,
            arguments,
            span: expr.span,
        })
    }
}