source -> kvpair
This commit is contained in:
parent
e6a5242e73
commit
54dde7c057
@ -115,7 +115,7 @@ struct scan {
|
|||||||
struct pairmap_table map;
|
struct pairmap_table map;
|
||||||
struct linemap_tree dates;
|
struct linemap_tree dates;
|
||||||
} edits;
|
} edits;
|
||||||
//struct
|
//struct kvpair_tree contacts;?
|
||||||
struct glider_tree gliders;
|
struct glider_tree gliders;
|
||||||
struct flight_tree flights;
|
struct flight_tree flights;
|
||||||
struct kjv_tree kjvs;
|
struct kjv_tree kjvs;
|
||||||
|
@ -14,22 +14,22 @@ int main(void) {
|
|||||||
const union line64 agenda = {{4,{{20,04,1996}}}},
|
const union line64 agenda = {{4,{{20,04,1996}}}},
|
||||||
before = {{1,{{1,1,1900}}}},
|
before = {{1,{{1,1,1900}}}},
|
||||||
noentry = {{3,{{1,6,1995}}}};
|
noentry = {{3,{{1,6,1995}}}};
|
||||||
const struct source *source;
|
const struct kvpair *source;
|
||||||
|
|
||||||
source = scan_source_lookup(&scn, agenda);
|
source = scan_source_lookup(&scn, agenda);
|
||||||
printf("agenda: <%.*s>\n",
|
printf("agenda: <%.*s>\n",
|
||||||
(int)(source->name.b - source->name.a), source->name.a);
|
(int)(source->key.b - source->key.a), source->key.a);
|
||||||
assert(pair_is_string(source->name, "1995agenda"));
|
assert(pair_is_string(source->key, "1995agenda"));
|
||||||
|
|
||||||
source = scan_source_lookup(&scn, before);
|
source = scan_source_lookup(&scn, before);
|
||||||
printf("before: <%.*s>\n",
|
printf("before: <%.*s>\n",
|
||||||
(int)(source->name.b - source->name.a), source->name.a);
|
(int)(source->key.b - source->key.a), source->key.a);
|
||||||
assert(pair_is_string(source->name, 0));
|
assert(pair_is_string(source->key, 0));
|
||||||
|
|
||||||
source = scan_source_lookup(&scn, noentry);
|
source = scan_source_lookup(&scn, noentry);
|
||||||
printf("noentry: <%.*s>\n",
|
printf("noentry: <%.*s>\n",
|
||||||
(int)(source->name.b - source->name.a), source->name.a);
|
(int)(source->key.b - source->key.a), source->key.a);
|
||||||
assert(pair_is_string(source->name, 0));
|
assert(pair_is_string(source->key, 0));
|
||||||
|
|
||||||
goto finally;
|
goto finally;
|
||||||
catch:
|
catch:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user