Goose  Diff

Differences From Artifact [ebc6d260f7]:

  • File bs/builtins/operators/helpers.h — part of check-in [55beba911a] at 2021-09-12 16:48:57 on branch trunk —
    • Started work on extensibility api
    • some code cleanup
    (user: achavasse size: 4003)

To Artifact [e9296f4f7d]:

  • File bs/builtins/operators/helpers.h — part of check-in [51f288ba2a] at 2021-09-13 21:52:06 on branch trunk —
    • Implemented a generic wrapper for the simple native types that can be embedded in Terms
    • Added more specific overloads for the assignment operator that should work only on builtin types, so that library and user defined types will be able to choose whether they're copyable
    • The EIR representation for all builtin runtime types are now prefixed with "rt_type" to more easily write generic matching rules against them
    • EIR: Fixed long standing bugs in Enumerate and Decompose that surfaced because of the above
    • Miscellaneous code cleaning
    (user: achavasse size: 3996)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef GOOSE_BUILTINS_OPERATORS_HELPERS_H
#define GOOSE_BUILTINS_OPERATORS_HELPERS_H

#include "builtins/helpers.h"

namespace goose::builtins
{
    using namespace goose::parse;

    template< typename... R >
    void BuildParseRule( sema::Env& env, const StringId& name, R&&... ruleBuilders )
    {
        parse::BuildParseRule( env, name, AppendToVectorTerm( RootG0Identity(), TERM( name ) ),
            forward< R >( ruleBuilders )... );
    }

    struct UnaryOpTag {};
    struct BinaryOpTag {};










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef GOOSE_BUILTINS_OPERATORS_HELPERS_H
#define GOOSE_BUILTINS_OPERATORS_HELPERS_H

#include "builtins/helpers.h"

namespace goose::builtins
{
    using namespace goose::parse;

    template< typename... R >
    void BuildParseRule( sema::Env& env, StringId name, R&&... ruleBuilders )
    {
        parse::BuildParseRule( env, name, AppendToVectorTerm( RootG0Identity(), TERM( name ) ),
            forward< R >( ruleBuilders )... );
    }

    struct UnaryOpTag {};
    struct BinaryOpTag {};