Goose  Diff

Differences From Artifact [c0553dc0a0]:

  • File bs/builtins/operators/helpers.h — part of check-in [c9a44e2fb9] at 2019-08-08 16:53:15 on branch trunk —
    • Implemented the local variable unification rule, which allows to read them.
    • Fixed comparison operators not returning bools.
    (user: achavasse size: 3823)

To Artifact [6b3b40cfb0]:

  • File bs/builtins/operators/helpers.h — part of check-in [2efa23555d] at 2019-08-11 01:26:17 on branch trunk —
    • ir: created a new type for LocationId which is handled in a specific way so that two LocationIds are always considered equal by pattern matching. This prevent the values' locationIds stored in ir expressions from fucking up everything.
    • propagate value locations in a few places: in the parser, when resolving invocations and when doing eager evaluation. There are probably a lot of other places still missing.
    • converted all the builtin statements to use the DiagnosticsManager.
    (user: achavasse size: 3923)

76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91
92
93
94
95

96
97
98
99
100

101
102
103
104
105
106
107
108
109
110
111

112
113
114
115
116
76
77
78
79
80
81
82

83
84
85
86
87
88
89
90
91
92
93
94

95
96
97
98
99

100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116







-
+











-
+




-
+










-
+





        {
            using intrinsicType = Intrinsic< Value ( T, T ) >;
            auto intrinsicFunc = []( const Value& lhs, const Value& rhs )
            {
                return BuildComputedValue( GetValueType< RT >(), I( lhs, rhs ) );
            };

            pOvlSet->add( e, ToValue< intrinsicType >( move( intrinsicFunc ) ) );
            pOvlSet->add( e, ToValue< intrinsicType >( move( intrinsicFunc ) ), GetFuncInvocationRule() );
        };
    }

    template< typename T, typename F >
    auto ForType( F&& func )
    {
        return [&]< typename tag >( auto&& e, auto&& pOvlSet, tag t )
        {
            if constexpr( is_same_v< tag, UnaryOpTag > )
            {
                using intrinsicType = Intrinsic< Value ( T ) >;
                pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ) );
                pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ), GetFuncInvocationRule() );
            }
            else
            {
                using intrinsicType = Intrinsic< Value ( T, T ) >;
                pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ) );
                pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ), GetFuncInvocationRule() );
            }
        };
    }

    template< typename T1, typename T2, typename F >
    auto ForTypes( F&& func )
    {
        return [&]< typename tag >( auto&& e, auto&& pOvlSet, tag t )
        {
            using intrinsicType = Intrinsic< Value ( T1, T2 ) >;
            pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ) );
            pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ), GetFuncInvocationRule() );
        };
    }
}

#endif