Goose  Artifact [ac33cb3a97]

Artifact ac33cb3a97dde85b2a0b4af48bdd2cf285af2785d7bd81311dbad0e0fd8bd5d4:

  • File bs/g0api/types.h — part of check-in [2ba2e560b1] at 2021-11-23 19:45:27 on branch trunk —
    • Parser: when encountering a prefix bracket block, parse it into a propositions list.
    • Builtins: when a proposition list is dropped (ie used as a stand alone statement), convert it into assert instructions.
    • Builtins: remove the builtin assert function, now replaced with the above so that propositions are always enclosed in brackets, regardless of where they are used. Also removes the confusion of making the assert function a compile-time check when its traditionally a runtime check
    (user: zlodo size: 1906)

#ifndef GOOSE_G0API_TYPEWRAPPERS_H
#define GOOSE_G0API_TYPEWRAPPERS_H

namespace goose::g0api
{
    extern void SetupTypeWrappers( Env& e );
}

namespace goose::builtins
{
    template<>
    struct TypeWrapperTraits< ptr< codegen::Module > >
    {
        static auto typeId() { return "CGModule"_sid; }
    };

    template<>
    struct TypeWrapperTraits< LocationId >
    {
        static auto typeId() { return "LocationId"_sid; }
    };

    template<>
    struct TypeWrapperTraits< StringId >
    {
        static auto typeId() { return "StringId"_sid; }
    };

    template<>
    struct TypeWrapperTraits< Hole >
    {
        static auto typeId() { return "Hole"_sid; }
    };

    template<>
    struct TypeWrapperTraits< AnyTerm >
    {
        static auto typeId() { return "AnyTerm"_sid; }
    };

    template<>
    struct TypeWrapperTraits< VecOfLength >
    {
        static auto typeId() { return "VecOfLength"_sid; }
    };

    template<>
    struct TypeWrapperTraits< pvec >
    {
        static auto typeId() { return "Vec"_sid; }
    };

    template<>
    struct TypeWrapperTraits< APSInt >
    {
        static auto typeId() { return "FixedInt"_sid; }
    };

    template<>
    struct TypeWrapperTraits< ptr< cir::BasicBlock > >
    {
        static auto typeId() { return "BasicBlock"_sid; }
    };

    template<>
    struct TypeWrapperTraits< wptr< cir::BasicBlock > >
    {
        static auto typeId() { return "BasicBlock"_sid; }
    };

    template<>
    struct TypeWrapperTraits< ptr< cir::Instruction > >
    {
        static auto typeId() { return "Instruction"_sid; }
    };

    template<>
    struct TypeWrapperTraits< ptr< cir::Terminator > >
    {
        static auto typeId() { return "Terminator"_sid; }
    };

    template<>
    struct TypeWrapperTraits< ptr< ReferenceType > >
    {
        static auto typeId() { return "ReferenceType"_sid; }
    };
}

#endif