#include "builtins/builtins.h"
#include "parse/parse.h"

using namespace goose::parse;
using namespace goose::cir;

namespace goose::builtins
{
    void SetupLower( Env& e )
    {
        // Default implementation of LowerType():
        // Do nothing.
        RegisterBuiltinFunc< Intrinsic< Value ( Value ) > >( e, e.extLowerType(),
            []( const Context& c, const Value& v )
            {
                return v;
            } );

        // Default implementation of LowerTypeForVerification():
        // Do nothing.
        RegisterBuiltinFunc< Intrinsic< Value ( Value ) > >( e, e.extLowerTypeForVerification(),
            []( const Context& c, const Value& v )
            {
                return v;
            } );

        // Default implementation of LowerConstantForVerification():
        // Do nothing.
        RegisterBuiltinFunc< Intrinsic< Value ( Value ) > >( e, e.extLowerConstantForVerification(),
            []( const Context& c, const Value& v )
            {
                return v;
            } );

        // Default implementation of LowerConstantForRuntime():
        // Do nothing.
        RegisterBuiltinFunc< Intrinsic< Value ( Value ) > >( e, e.extLowerConstantForRuntime(),
            []( const Context& c, const Value& v )
            {
                return v;
            } );
    }
}
