summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-07-22 07:18:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-07-22 07:18:58 -0700
commitcddd91863740e560ae95ccdd2be5aa0e128713ed (patch)
tree5a3e8391212f63afd0366a7543e25ea5d9eaf78f /parser.c
parent8eba1ea78d3c264673b957f20013694fd77ddf07 (diff)
downloadtxr-cddd91863740e560ae95ccdd2be5aa0e128713ed.tar.gz
txr-cddd91863740e560ae95ccdd2be5aa0e128713ed.tar.bz2
txr-cddd91863740e560ae95ccdd2be5aa0e128713ed.zip
hash: change make_hash interface.
The make_hash function now takes the hash_weak_opt_t enumeration instead of a pair of flags. * hash.c (do_make_hash): Take enum argument instead of pair of flags. Just store the option; nothing to calculate. (weak_opt_from_flags): New static function. (tweak_hash): Function removed. (make_seeded_hash): Adjust to new do_make_hash interface with help from weak_opt_from_flags. (make_hash, make_eq_hash): Take enum argument instead of pair of flags. (hashv): Calculate hash_weak_opt_t enum from the extracted flags, pass down to make_eq_hash or make_hash. * hash.h (tweak_hash): Declration removed. (make_hash, make_eq_hash): Declarations updated. * eval.c (me_case, expand_switch): Update make_hash calls to new style. (eval_init): Update make_hash calls and get rid of tweak_hash calls. This renders the tweak_hash function unused. * ffi.c (make_ffi_type_enum, ffi_init): Update make_hash calls to new style. * filter.c (make_trie, trie_add, filter_init): Likewise. * lib.c (make_package_common, obj_init, obj_print): Likewise. * lisplib.c (lisplib_init): Likewise. * match.c (dir_tables_init): Likewise. * parser.c (parser_circ_def, repl, parse_init): Likewise. * parser.l (parser_l_init): Likewise. * struct.c (struct_init, get_slot_syms): Likewise. * sysif.c (get_env_hash): Likewise. * lex.yy.c.shipped, y.tab.c.shipped: Updated.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/parser.c b/parser.c
index ff79ec3f..642804bd 100644
--- a/parser.c
+++ b/parser.c
@@ -481,7 +481,7 @@ void parser_resolve_circ(parser_t *p)
void parser_circ_def(parser_t *p, val num, val expr)
{
if (!p->circ_ref_hash) {
- p->circ_ref_hash = make_eq_hash(nil, nil);
+ p->circ_ref_hash = make_eq_hash(hash_weak_none);
setcheck(p->parser, p->circ_ref_hash);
}
@@ -1478,7 +1478,7 @@ val repl(val bindings, val in_stream, val out_stream, val env)
val var_counter_sym = intern(lit("*v"), user_package);
val result_hash_sym = intern(lit("*r"), user_package);
val path_private_to_me_p = intern(lit("path-private-to-me-p"), user_package);
- val result_hash = make_hash(nil, nil, nil);
+ val result_hash = make_hash(hash_weak_none, nil);
val done = nil;
val counter = one;
val home = if3(repl_level == 1, get_home_path(), nil);
@@ -1878,7 +1878,7 @@ void parse_init(void)
parser_cls = cobj_register(parser_s);
protect(&stream_parser_hash, &unique_s, &catch_all, convert(val *, 0));
- stream_parser_hash = make_hash(weak_and_k, nil, nil);
+ stream_parser_hash = make_hash(hash_weak_and, nil);
catch_all = cons(t, nil);
parser_l_init();