Goose  Artifact [7d2f751447]

Artifact 7d2f7514475df7c834635cc1f54fba86c960206031be50a3c938406bc29a981c:

  • File bs/sema/inv-func.cpp — part of check-in [75e7722591] at 2019-01-28 23:22:09 on branch trunk —
    • Builtin funcs: build the function signature and store it in the function type.
    • Sema: update the pattern for the function invocation rule because of the above.
    (user: achavasse size: 960)

#include "sema.h"

namespace empathy::sema
{
    class FunctionInvocationRule : public InvocationRule
    {
        public:
            virtual optional< Value > resolveInvocation( const ptr< Env >& env, const Value& callee, const Value& args ) const override
            {
                // Just a placeholder for now
                cout << "func invocation\n";
                return nullopt;
            }

            virtual Term getSignature( const ptr< Env >& env, const Value& callee ) const override
            {
                // Just a placeholder for now
                return TSID( func_sig_placeholder );
            }
    };

    void SetupFunctionInvocationRule( InvocationRuleSet& ruleSet )
    {
        ruleSet.addRule(
            ValueToIRExpr( Value( TSID( type ), TVEC( TSID( func ),
                ANYTERM( k ), ANYTERM( rt ), ANYTERM( p ), ANYTERM( sig ) ) ) ),
                make_shared< FunctionInvocationRule >() );
    }
}