Goose  Diff

Differences From Artifact [3ea19ac6e5]:

  • File bs/sema/template.cpp — part of check-in [1c4c7dde4c] at 2019-02-24 15:37:01 on branch trunk — Templates: implemented the template rules for Decl, TDecl, TNamedDecl and TVar. (user: achavasse size: 1148)

To Artifact [1916728f97]:

  • File bs/sema/template.cpp — part of check-in [12c9e92618] at 2019-02-24 23:18:18 on branch trunk — Templates: implemented the template function invocation rule. Some pieces are still missing before it can work. (user: achavasse size: 1717)

37
38
39
40
41
42
43


















44
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

    {
        const auto pTemplateRuleSet = GetTemplateRuleSet( c, tpl );
        if( !pTemplateRuleSet )
            return nullopt;

        return pTemplateRuleSet->buildSignature( c, tpl );
    }

    optional< Value > BuildTemplateParam( const Context& c, const Value& tpl, const Value& arg )
    {
        const auto pTemplateRuleSet = GetTemplateRuleSet( c, tpl );
        if( !pTemplateRuleSet )
            return nullopt;

        return pTemplateRuleSet->buildParamDecl( c, tpl, arg );
    }

    void TemplateSetup( const Context& c, UnificationContext& uc, const Value& tpl )
    {
        const auto pTemplateRuleSet = GetTemplateRuleSet( c, tpl );
        if( !pTemplateRuleSet )
            return;

        pTemplateRuleSet->setup( c, uc, tpl );
    }
}