Goose  Diff

Differences From Artifact [1af039e945]:

  • File bs/parse/rule-helpers.cpp — part of check-in [0e66d22527] at 2019-03-30 15:30:31 on branch trunk —
    • Changed type's type representation to be able to pass types around as value anywhere.
    • Fixed a bunch of bugs.
    (user: achavasse size: 1067)

To Artifact [0f9afb2520]:

  • File bs/parse/rule-helpers.cpp — part of check-in [cde0c6d0e3] at 2019-06-19 19:49:50 on branch trunk —
    • parser: don't hardcode the builtins identity prefix in the rule helpers anymore.
    • builtins: move the common identity prefix used by all builtins into a separate function, to be able to easily change it.
    • builtins: prepend the CompileTime domain specifier to the root builtin identity.
    • sema: don't store the domain separately, extract it from the identity when needed instead.
    (user: achavasse size: 1043)

26
27
28
29
30
31
32
33

34
35
36
37

38
39
26
27
28
29
30
31
32

33
34
35
36

37
38
39







-
+



-
+


        const auto& p = get< ptr< void > >( content );
        return static_pointer_cast< parse::Rule >( p );
    }
}

namespace empathy::parse
{
    void RegisterRule( sema::Env& env, const StringId& name, Rule&& rule )
    void RegisterRule( sema::Env& env, const Term& identity, Rule&& rule )
    {
        auto ruleVal = ToValue( move( rule ) );
        auto ruleTerm = ValueToIRExpr( ruleVal );
        env.storeValue( TVEC( TSID( e0 ), TERM( name ) ), ANYTERM( _ ), ruleTerm );
        env.storeValue( identity, ANYTERM( _ ), ruleTerm );
    }
}