Goose  Diff

Differences From Artifact [4222297e12]:

  • File bs/builtins/api/compiler.cpp — part of check-in [ec58d0ff48] at 2019-08-13 21:21:52 on branch trunk —
    • Completed the diagnostics renderer.
    • Fixed a few places where value poisoning wasn't correctly propagated.
    (user: achavasse size: 6098)

To Artifact [f7f36709e8]:

  • File bs/builtins/api/compiler.cpp — part of check-in [980effe072] at 2019-08-14 02:30:10 on branch trunk —
    • Added an unification rule to deal with LocationIds. It honors poisoning and preserve the most recent location from the input values.
    • Added a diagnostic context indicating the point at which a template function passed as a value has been instantiated.
    • Added a trace mode that logs the diagnostics contexts, which can be activated by calling a compile time function.
    • Added a few diagnostic messages tests.
    (user: achavasse size: 6324)

1
2
3
4
5
6
7
8
9
10
11






12
13
14
15
16
17
18
#include "builtins/builtins.h"
#include "parse/parse.h"
#include "execute/execute.h"

using namespace empathy;

namespace empathy::builtins
{
    void SetupApiCompiler( Env& e )
    {
        weak_ptr< Env > pEnv = e.shared_from_this();







        RegisterBuiltinFunc< Eager< Value > ( Value, string ) >( e, "ExternalFunction"_sid,
            [pEnv]( const Value& f, const string& symbol )
            {
                auto ft = FromValue< FuncType >( f );
                if( !ft )
                    return ToValue( "error"s ).setPoison();











>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "builtins/builtins.h"
#include "parse/parse.h"
#include "execute/execute.h"

using namespace empathy;

namespace empathy::builtins
{
    void SetupApiCompiler( Env& e )
    {
        weak_ptr< Env > pEnv = e.shared_from_this();

        RegisterBuiltinFunc< Eager< void > ( bool ) >( e, "DiagnosticsTraceMode"_sid,
            [pEnv]( bool enable )
            {
                DiagnosticsManager::GetInstance().setTraceMode( enable );
            } );

        RegisterBuiltinFunc< Eager< Value > ( Value, string ) >( e, "ExternalFunction"_sid,
            [pEnv]( const Value& f, const string& symbol )
            {
                auto ft = FromValue< FuncType >( f );
                if( !ft )
                    return ToValue( "error"s ).setPoison();