Jeremy Wall fa96c7c0ef FEATURE: UCG Parameterized Modules
closes #10

Squashed commit of the following:

commit 3101c2bb9a385ed9e84481d36906a3e3ce93e571
Author: Jeremy Wall <jeremy@marzhillstudios.com>
Date:   Wed Nov 21 20:10:31 2018 -0600

    FEATURE: Module evaluation

    * handle evaluating the module definition.
    * Handle performing a module instantiation via the copy syntax.

commit 4ca863896b416e39f0c8eacc53384b9c514f6f14
Author: Jeremy Wall <jeremy@marzhillstudios.com>
Date:   Tue Nov 20 18:38:19 2018 -0600

    FEATURE: Add module parsing expression parsing to ucg.

    changes toward issue #10
2018-11-23 12:51:13 -06:00

25 lines
755 B
Plaintext

let site_mod = module{
hostname="",
port=0,
db="localhost",
db_user="admin",
db_pass="password"
} => { // mods do not close over their environment.
// this binding is not visible outside of the module. should be at the time of definition?
// or path should be rewritten to be absolue before instantiation.
import "../../shared.ucg" as shared;
// processing should be delayed till module instantiation.
let base_config = shared.mk_site_config(mod.hostname, mod.port);
let config = base_config{ // processing should also be delayed.
dbs = [
{
database = mod.db,
user = mod.db_user,
pass = mod.db_pass,
},
],
};
};