ucg/examples/test.ucg
Jeremy Wall 97c97ced55 Finish splitting the Tokenization and parsing stages.
* Added some helper matcher macros for tokens.
* Added some helper assertion macros for tests.
* Tokenization and Parsing are two separate stages.
2018-02-02 15:29:24 -06:00

26 lines
683 B
Plaintext

// A few constants.
let dbhost1 = "db1.prod.net";
let dbhost2 = "db2.prod.net";
let dbname = "testdb";
// Constructor for database connection strings.
let mk_db_conn = macro (host, port, db) => {
host = host,
port = port,
db = db,
conn_string = "@:@/@" % (host, port, db)
};
let db_conn1 = mk_db_conn(dbhost1, 3306, dbname);
let db_conn2 = mk_db_conn(dbhost2, 3306, dbname);
// We have two database connections in a list
let db_conns = [db_conn1.conn_string, db_conn2.conn_string];
// Our server configuration.
let server_config = {
dbconn_list = db_conns,
db_conn1 = db_conns.0, // connection one
db_conn2 = db_conns.1,
tmpldir = "./templates"
};