Goose  Artifact [7d952ec4fe]

Artifact 7d952ec4feb906a3d5fe8c7b502ff6c2e9855592c89ad705f8f00d809760b71e:

  • File bs/g0api/support/verification.cpp — part of check-in [b397dc5a7c] at 2021-09-12 12:34:40 on branch trunk — Split out the compile time api function out of builtins and into their own library (user: achavasse size: 482)

#include "g0api/g0api.h"
#include "eir/eir.h"
#include "parse/parse.h"

using namespace goose;
using namespace goose::parse;

namespace goose::g0api
{
    void SetupApiVerificationFuncs( Env& e )
    {
        RegisterBuiltinFunc< Intrinsic< Value ( bool ) > >( e, "assert"_sid,
            []( const Context& c, const Value& cond )
            {
                return BuildComputedValue( GetValueType< void >(),
                    cir::Assert( cond ) );
            } );
    }
}