source -> kvpair

This commit is contained in:
Neil 2023-05-07 00:22:58 -07:00
parent e6a5242e73
commit 54dde7c057
2 changed files with 8 additions and 8 deletions

View File

@ -115,7 +115,7 @@ struct scan {
struct pairmap_table map;
struct linemap_tree dates;
} edits;
//struct
//struct kvpair_tree contacts;?
struct glider_tree gliders;
struct flight_tree flights;
struct kjv_tree kjvs;

View File

@ -14,22 +14,22 @@ int main(void) {
const union line64 agenda = {{4,{{20,04,1996}}}},
before = {{1,{{1,1,1900}}}},
noentry = {{3,{{1,6,1995}}}};
const struct source *source;
const struct kvpair *source;
source = scan_source_lookup(&scn, agenda);
printf("agenda: <%.*s>\n",
(int)(source->name.b - source->name.a), source->name.a);
assert(pair_is_string(source->name, "1995agenda"));
(int)(source->key.b - source->key.a), source->key.a);
assert(pair_is_string(source->key, "1995agenda"));
source = scan_source_lookup(&scn, before);
printf("before: <%.*s>\n",
(int)(source->name.b - source->name.a), source->name.a);
assert(pair_is_string(source->name, 0));
(int)(source->key.b - source->key.a), source->key.a);
assert(pair_is_string(source->key, 0));
source = scan_source_lookup(&scn, noentry);
printf("noentry: <%.*s>\n",
(int)(source->name.b - source->name.a), source->name.a);
assert(pair_is_string(source->name, 0));
(int)(source->key.b - source->key.a), source->key.a);
assert(pair_is_string(source->key, 0));
goto finally;
catch: