Goose  Diff

Differences From Artifact [a081f56126]:

  • File bs/builtins/statements/using.cpp — part of check-in [c1b9248768] at 2019-07-29 01:15:18 on branch trunk —
    • Fixed a stupid, recent bug in using that was preventing it from registering the import rule to make things from its parent scope visible.
    • Fixed some issues with functions and domains.
    • Added a sample program that (almost) constructs a working hello world binary, manually for now in the absence of a proper front end.
    (user: achavasse size: 5000)

To Artifact [d141fc58c2]:

  • File bs/builtins/statements/using.cpp — part of check-in [09150fdc1c] at 2019-07-30 14:25:53 on branch trunk — parser: setup proper visibility rules for nested brace blocks. (user: achavasse size: 4998)

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
            const auto& context = p.resolver()->context();

            // Create a local identity for the constant, from which the current identity will be visible.
            // This is to avoid anything declared from within the using expression to leak outside,
            // and also to make sure that whenever it will be parsed, it will have access to the current
            // context in which it has been declared.
            auto localIdentity = AppendToVectorTerm( context.identity(), *nameTerm );
            context.env()->addTransitiveImport( context.identity(), localIdentity );

            variant< vector< Term >, Term > content = move( toks );

            bool bInUse = false;

            auto UsingValProvider = [content, localIdentity, bInUse]( Env& e, const Term& identity, const Term& contextId, Term& result ) mutable
            {







|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
            const auto& context = p.resolver()->context();

            // Create a local identity for the constant, from which the current identity will be visible.
            // This is to avoid anything declared from within the using expression to leak outside,
            // and also to make sure that whenever it will be parsed, it will have access to the current
            // context in which it has been declared.
            auto localIdentity = AppendToVectorTerm( context.identity(), *nameTerm );
            context.env()->addVisibilityRule( context.identity(), localIdentity );

            variant< vector< Term >, Term > content = move( toks );

            bool bInUse = false;

            auto UsingValProvider = [content, localIdentity, bInUse]( Env& e, const Term& identity, const Term& contextId, Term& result ) mutable
            {