Call expressions

CallExpression :
   Expression GenericArgs? ( CallParams? )

GenericArgs :

CallParams :
   CallArg ( , CallArg )* ,?

CallArg :
   (CallArgLabel =)? Expression

CallArgLabel :
   IDENTIFIERLabel must correspond to the name of the called function argument at the given position. It can be omitted if parameter name and the name of the called function argument are equal.

A call expression calls a function. The syntax of a call expression is an expression, followed by a parenthesized comma-separated list of call arguments. Call arguments are expressions, and must be labeled and provided in the order specified in the function definition. If the function eventually returns, then the expression completes.


contract Foo {

    pub fn demo(self) {
        let ann: address = 0xaa
        let bob: address = 0xbb
        self.transfer(from: ann, to: bob, 25)

    pub fn transfer(self, from: address, to: address, _ val: u256) {}